I remember all Objective-C guides and samples show me to use @class CLASS_NAME in header file, then use #import CLASS_HEADER.
I just want to know why not use #import CLASS_HEADER in header file directly, so that you don't need to modify two files.
I just want to know why not use #import CLASS_HEADER in header file directly, so that you don't need to modify two files.
Code:
// xxx.h
@class DetailTableViewController;
@interface MasterTableViewController : UITableViewController {
DetailTableViewController *detailTableViewController;
}
// xxx.m
#import "DetailTableViewController.h"
@implementation MasterTableViewController
@synthesize detailTableViewController;
Code:
// xxx.h
#import "DetailTableViewController.h"
@interface MasterTableViewController : UITableViewController {
DetailTableViewController *detailTableViewController;
}
// xxx.m
@implementation MasterTableViewController
@synthesize detailTableViewController;