【发布时间】:2011-06-11 09:04:31
【问题描述】:
如果我在 xcode 4 代码完成中使用点符号对我不起作用(按 ESC):
NSString *s = @"demo";
NSLog(@"%lu", [s length]); //[s <ESC> code completion works fine
NSLog(@"%lu", s.length); //s.<ESC> code completion doesn't work
??
【问题讨论】:
如果我在 xcode 4 代码完成中使用点符号对我不起作用(按 ESC):
NSString *s = @"demo";
NSLog(@"%lu", [s length]); //[s <ESC> code completion works fine
NSLog(@"%lu", s.length); //s.<ESC> code completion doesn't work
??
【问题讨论】:
确保该属性定义了有效的@property 访问器。
// 在.h中
@property (assign) int 长度;
// 在.m中
@synthesize 长度;
请记住,您可以拥有自己的访问器和设置器,但我认为代码感知需要 @property 来显示点符号。
【讨论】: