大佬教程收集整理的这篇文章主要介绍了Objective-C中的私有方法,在Xcode 4.3中我不再需要在我的实现文件中声明它们?,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
像我的.m文件:
// deleting this with xcode 4.3 the below code still does work // in prevIoUs versions i had to put this because otherwise the compiler can't find methodFirst @interface DetailViewController () - (void)methodFirst; - (void)methodSecond; @end @implementation DetailViewController - (void) methodSecond { // if i delete the forWARD declaration Now adays i dont get a compiler error that he cant find method first [self methodFirst]; } - (void) methodFirst { } @end
一些Xcode 4.3 beta的发行说明中注意到这一变化,但显然没有将其纳入“Xcode 4.3的新功能”最终文档。
与其他答案中建议的不同,这不仅仅是默认情况下已关闭的“未声明的选择器”警告。实际上,如果您使用ARC,则无法识别的选择器仍然是硬错误。尝试调用[self myNonexistentMethod],你会看到;编译器仍然抱怨。
以上是大佬教程为你收集整理的Objective-C中的私有方法,在Xcode 4.3中我不再需要在我的实现文件中声明它们?全部内容,希望文章能够帮你解决Objective-C中的私有方法,在Xcode 4.3中我不再需要在我的实现文件中声明它们?所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。