我一直在类文件中设置我的方法原型,而不是头文件。我不确定它是否真的有所作为,我应该使用头文件。iPhone方法原型
以这种方式设置原型有缺点或优点吗?
#import "SettingsViewController.h"
@interface SettingsViewController()
- (void)syncSettings;
@end
@implementation SettingsViewController
- (void)syncSettings
{
// Code Here
}
// Other Methods
@end
[可能在.h文件和.m文件中指定@interface和@end声明方法之间的差异的重复(http://stackoverflow.com/questions/8196170/difference-between-declaring-methods-in- h-file-and-in-m-file-specify-inter) – 2012-03-01 03:00:03