鉴于此协议定义:
@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