我想從標籤(文本)爲Apple Watch做int; (Objective-C的) 此代碼在iPhone上工作:如何從標籤(文本)int看WatchKit
int minNumber = [[minField text] intValue];
如何做到像蘋果手錶嗎?
當我試圖相同的代碼,iPhone應用程序...錯誤:
No visible @interface for 'WKInterfaceLabel' declares the selector 'text'
我想從標籤(文本)爲Apple Watch做int; (Objective-C的) 此代碼在iPhone上工作:如何從標籤(文本)int看WatchKit
int minNumber = [[minField text] intValue];
如何做到像蘋果手錶嗎?
當我試圖相同的代碼,iPhone應用程序...錯誤:
No visible @interface for 'WKInterfaceLabel' declares the selector 'text'
WatchKit對象沒有干將,這意味着你不能讀取它們的屬性的當前值。
這在docs描述:
Communication between an interface object and the corresponding view on Apple Watch is one way, with information flowing from your WatchKit extension to Apple Watch. In other words, you set values on an interface object but you cannot get the current values of its attributes.
它不工作。錯誤:'WKInterfaceLabel'沒有可見的@interface聲明選擇器'文字' – Stan