xcode 4 dot notation code sense problem

醉酒当歌 提交于 2019-12-24 03:19:23

问题


if i use dot notation in xcode 4 code completion doesn't work for me (pressing 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

??


回答1:


Make sure that the property has a valid @property accessor defined.

// in .h

@property (assign) int length;

// in .m

@synthesize length;

Keep in mind you can have your own accessors and setters, but I think code-sense needs @property to show up the dot notation.



来源:https://stackoverflow.com/questions/6315080/xcode-4-dot-notation-code-sense-problem

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!