我有一些快速的經驗,但對目標 C 零知識我需要在控制臺中列印一個時間戳,這里是:
CMTime timeStamp = CMTimeMake(frame.timeStampNs / rtc::kNumNanosecsPerMillisec, 1000);
我添加了類似的內容:
NSLog(@timeStamp);
但它失敗了,我需要快速列印類似的東西:
print("Timestamp: \(timeStamp)"
你能告訴我如何在目標c上做到這一點嗎?
謝謝
uj5u.com熱心網友回復:
%f對 64 位浮點數使用格式說明符(雙精度)
NSLog("Timestamp: %f", CMTimeGetSeconds(timeStamp));
https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/Strings/Articles/formatSpecifiers.html
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/462943.html
標籤:目标-c
