我想添加一些按鈕到我的導航控制器的工具欄:我看到工具欄,但沒有按鈕。這是我的代碼,我設置工具欄部分...導航控制器工具欄按鈕問題 - Xcode
(這是我的AppDelegate)
// Create a table view controller
RootViewController *rootViewController = [[RootViewController alloc]
initWithStyle:UITableViewStyleGrouped];
rootViewController.managedObjectContext = context;
rootViewController.entityName = @"County";
//Navigation Controller
UINavigationController *aNavigationController = [[UINavigationController alloc]
initWithRootViewController:rootViewController];
self.navigationController = aNavigationController;
//Barbuttons
UIBarButtonItem *homeButton;
homeButton = [[[UIBarButtonItem alloc] initWithTitle:@" Inizio " style:UIBarButtonItemStyleBordered target:self action:@selector(home)] autorelease];
UIBarButtonItem *barButton;
barButton = [[[UIBarButtonItem alloc] initWithTitle:@" Funzioni online " style:UIBarButtonItemStyleBordered target:self action:@selector(caricamappa)] autorelease];
UIBarButtonItem *creditsButton;
creditsButton = [[[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"credits2.png"] style:UIBarButtonItemStyleBordered target:self action:@selector(credits)] autorelease];
NSArray *baritems = [NSArray arrayWithObjects: homeButton, barButton, creditsButton, nil];
[window addSubview:[navigationController view]];
[self.navigationController.toolbar setItems:baritems];
[self.navigationController setToolbarHidden:NO];
[window makeKeyAndVisible];
[rootViewController release];
[aNavigationController release];
關於我的錯誤任何想法?