1
我有一個WatchKit擴展項目,我正在遷移到WatchOS 2.0,出於某種原因遷移後,我收到一個編譯器錯誤,指出NSTextAttachment是一個未知類型。我不確定這是否是Xcode 7的錯誤。它在Xcode 6和WatchOS 1中工作正常。它只是提到NSTextAttachment的所有內容都給了我這個問題。它不適用於WatchOS 2.0或其他?NSTextAttachment不能在WatchOS 2上工作?
下面的代碼:
NSTextAttachment *attachment = [[NSTextAttachment alloc] init];
導致錯誤:
Unknown type name 'NSTextAttachment'; did you mean 'NSTextAlignment'?
Use of undeclared identifier 'NSTextAttachment'
其他一切像NSAttributedString等作品。