【发布时间】:2011-02-14 16:42:55
【问题描述】:
我在 viewDidLoad 方法中使用调试器进行了检查,tracerTableView 为 0x0,我认为这意味着它为零。我不明白。我应该说是的,我已经检查了我的笔尖文件,是的,所有的连接都是正确的。这是头文件和.m的乞求。
.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
}
【问题讨论】:
标签: iphone objective-c cocoa-touch ipod-touch