このプロトコル定義を考えると:
@protocol MyProtocol <NSObject>
@property (nonatomic, strong) NSString *someProperty;
@end
Xcodeがこのステートメントのオートコンプリートを喜んで提供するのはなぜですか。
id<MyProtocol> thing = [ThingManager currentThing];
[thing someProperty]; // Xcode offered autocompletion here
しかし、ドット表記を使用して同じプロパティにアクセスしようとすると、オートコンプリートは提供されません。
id<MyProtocol> thing = [ThingManager currentThing];
thing.someProperty; // Xcode claimed there were
// "No completions" available
// after the period