xcode 4 点符号代码意义问题 [英] xcode 4 dot notation code sense problem

查看:24
本文介绍了xcode 4 点符号代码意义问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我在 xcode 4 代码完成中使用点符号对我不起作用(按 ESC):

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

??

推荐答案

确保属性定义了有效的 @property 访问器.

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

//在 .h 中

@property (assign) int length;

@property (assign) int length;

//以 .m 为单位

@synthesize 长度;

@synthesize length;

请记住,您可以拥有自己的访问器和设置器,但我认为代码感知需要 @property 来显示点符号.

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

这篇关于xcode 4 点符号代码意义问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆