Objective-C - 预期的标识符错误驱使我疯了 [英] Objective-C – Expected identifier error driving me crazy
本文介绍了Objective-C - 预期的标识符错误驱使我疯了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在尝试编译我的代码时遇到预期的标识符错误。
I'm getting an expected identifier error when I try to compile my code.
careerURL在.h文件中设置如下:
careerURL is setup like this in .h file:
@property (nonatomic, copy) NSString *careerURL;
在.m文件中这样合成:
And synthesized like this in .m file:
@synthesize careerURL;
我真的不明白这里的问题是什么。确切的代码适用于另一个视图控制器。
I really do not understand what is the issue here. The exact code works in another viewcontroller.
推荐答案
/ p>
You should either use dot .
syntax,
NSString *wtf = self.careerURL;
或Objective-C消息语法,
Or Objective-C message syntax,
NSString *wtf = [self careerURL];
不能同时。
这篇关于Objective-C - 预期的标识符错误驱使我疯了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文