我在viewDidLoad方法中使用debbuger進行了檢查,tracerTableView是0x0,我認爲這意味着它是零。我不明白。我應該去ahaed說是的,我已經檢查了我的筆尖文件,是的所有的連接都是正確的。這是頭文件和.m的請求。爲什麼我的UITableView沒有設置?
.h文件中
@interface TrackerListController : UITableViewController <AddPackageDelegate>{
// The mutable (modifiable) dictionary days holds all the data for the days tab
NSMutableArray *trackerList;
UITableView *tracerTableView;
}
@property (nonatomic, retain) NSMutableArray *trackerList;
@property (nonatomic, retain) IBOutlet UITableView. *tracerTableView;
//The addPackage: method is invoked when the user taps the addbutton created at runtime.
-(void) addPackage : (id) sender;
@end
.m文件
@implementation TrackerListController
@synthesize trackerList, tracerTableView;
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"Package Tracker";
self.navigationItem.leftBarButtonItem = self.editButtonItem;
UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(addPackage:)];
// Set up the Add custom button on the right of the navigation bar
self.navigationItem.rightBarButtonItem = addButton;
[addButton release];
// Release the addButton from memory since it is no longer needed
}