0
我在导航栏或控制器顶部制作tableview时遇到了问题。初始化导航栏
我有这样的一段代码,
- (void)viewDidLoad {
[super viewDidLoad];
UINavigationController *addNavCon = [[UINavigationController alloc]initWithNibName:@"Welcome" bundle:nil];
self.navigationItem.rightBarButtonItem = self.addButtonItem;
self.navigationItem.leftBarButtonItem = self.editButtonItem;
[self createEditableCopyOfDatabaseIfNeeded];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationWillTerminate:) name:UIApplicationWillTerminateNotification object:nil];
NSString *documentDirectory = [self applicationDocumentsDirectory];
NSString *path = [documentDirectory stringByAppendingPathComponent:@"notebook.plist"];
NSMutableArray *tmpArray = [[NSMutableArray alloc] initWithContentsOfFile:path];
self.Notes = tmpArray;
[tmpArray release];
}
然而,在导航栏上从来没有出现,而表做精。我可以知道代码有什么问题吗?
非常感谢
谢谢你这样做在App代表,这是非常有帮助的。 – Clarence
但是如果我不想将它添加到整个应用程序呢?如果我只是希望它出现在应用程序的一个视图中,该怎么办?我试图把它们放在viewDidLoad中,但不起作用。谢谢 – Clarence