В моем приложении у меня есть контроллер uitabbar для управления тремя контроллерами представления. Теперь я хочу добавить звук, если пользователь нажал любую из вкладок. Исходный код:
// Declare all three view controllers
nextview *con = [[nextview alloc]init];
nextview1 *con1= [[nextview1 alloc] init];
nextview2 *con2 = [[nextview2 alloc] init];
//declare tab barcontroller
UITabBarController *tabBarController = [[UITabBarController alloc] init];
tabBarController.view.frame = CGRectMake(0, 0, 320, 480);
// Set each tab to show an appropriate view controller
[tabBarController setViewControllers:[NSArray arrayWithObjects:con,con1,con2, nil]];