我想知道爲什麼會有@interface
兩次。一個在class.h
和其他class.m
。例如:爲什麼在@implementation上面有@interface?
TestTableViewController.h
:
#import <UIKit/UIKit.h>
@interface TestTableViewController : UITableViewController
@end
和(自動生成)class.m
我發現:
#import "TestTableViewController.h"
@interface TestTableViewController()
@end
@implementation TestTableViewController
... methods delegated from UITable delegates
@end
所以我的問題是,什麼在.m
文件@interface TestTableViewController()
左右。爲什麼它在那裏?我需要它嗎?
在此先感謝
[在.h和.m文件中的\ @interface定義之間的差異]的可能重複(http://stackoverflow.com/questions/3967187/difference-between-interface-definition-in-h-and-m-文件),[用於iOS 5項目的.m文件中的\ @接口聲明是什麼?](http://stackoverflow.com/questions/9751057/what-is-the-interface-declaration-in-m-文件用於在ios 5項目),[兩個接口在* .h和* .m文件](http://stackoverflow.com/questions/9590917)[聲明接口內的實現文件(Objective- C)](http://stackoverflow.com/questions/10647913/) – 2012-07-21 17:54:12