XCode 4 - @private
我不知道这是否是我不小心勾选的一些设置,但请告诉我如何修复它:
每当我创建一个新的 Obj-C 类时,它会自动看起来像:
#import <Foundation/Foundation.h>
@interface MathUtilities : NSObject {
**@private**
}
@end
该行会自动插入。它以前从未存在过,但有些东西没有添加它。我的文件现在还带有 init 和 dealloc 方法。发生什么事了吗?另外,难道不应该进口可可而不是基金会吗?
这是 XCode 4
I don't know if it's some setting I accidentally ticked, but tell me how to fix it please:
Whenever I create a new Obj-C class, it automatically looks like:
#import <Foundation/Foundation.h>
@interface MathUtilities : NSObject {
**@private**
}
@end
That line is automatically inserted. It never was there before, but something is not adding it. My files also now come with init and dealloc methods. Did something happen? Also, shouldn't it be importing Cocoa instead of Foundation?
This is XCode 4
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没有什么需要修复的。 XCode 正在创建存根供您填写代码。这可以节省时间,仅此而已。它应该为您生成一个头文件和实现存根文件,您可以像这样扩展它:
您的头文件(MathUtilities.h):
您的实现文件(MathUtilities.m):
There is nothing to fix. XCode is creating stubs for you to fill out your code into. It's a time saver, thats all. It should be generating a header and implementation stub file for you, which you can extend like so:
Your header file (MathUtilities.h):
Your implementation file (MathUtilities.m) :