【发布时间】:2011-04-24 09:30:50
【问题描述】:
在 xcode 4 中,当我尝试使用 Mac OS X 的模板创建一个类,例如“ABClass”时,创建文件时的最终结果是:
//header
#import <Foundation/Foundation.h>
@interface DBFTimer : NSObject {
@private
}
@end
和其他文件
//.m file
#import "DBFTimer.h"
@implementation DBFTimer
- (id)init
{
self = [super init];
if (self) {
// Initialization code here.
}
return self;
}
- (void)dealloc
{
[super dealloc];
}
@end
这是一个错误吗?解决方案是什么? (运行 Xcode 4 Build 4A304a)
编辑:好的,现在我明白为什么了,因为这是NSObject 的子类,因此只需要基础标头。
【问题讨论】:
-
你认为这门课为什么适合 Cocoa Touch?
-
我选择的类是 mac os x 上 cocoa 的 Objective-c 类。 iOS 上 cocoa touch 的 Objective-c 类使用
而不是
标签: objective-c cocoa macos xcode4