Tag: uinavigationcontroller

Show Alert in clickedButtonAtIndex?

i need to show a confirm alert after the user press buttonIndex 1 but… if i use popViewcontroller in clickedButtonAtIndex it crash without errors. The problem is that [self.navigationController popViewControllerAnimated:YES]; is called before second Alert click… how to fix? This is my code: – (void) alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { if (buttonIndex == 1) { UIAlertView […]

how to push view controller from a UIView's subclass

I created a view “CategoryTableView” that subclass from UIView. And CategoryTableView contains a UITableView. I added CategoryTableView as a subview to HomeViewController that subclass from UIViewController. Right now, I want to push a new view controller when didSelectRowAtIndexPath executes. But, in CategoryTableView, how do I push or present another view controller. I can’t get to […]

passing data/objects/moc between viewcontrollers – best practice

I have a scenario that i suspect is very common, i’ve found various ideas in responses to other similar questions including setting up IBOutlets, passing NSmanagedobjects as properties and just using one view controller but swapping out the views but I’m uncertain as to which would be the best idea to implement for my solution. […]

iphone: Forcefully change orientation from portrait to landscape on navigation

Is there any way that we can Forcefully change app orientation from portrait to landscape while navigating ? I have a requirement that while pushing controller from A to B. B should be in landscape but my A controller is in portrait.

Back button not appearing on UINavigationController

I have a UINavigationController setup in my AppDelegate: – (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Add the navigation controller’s view to the window and display. [self.window addSubview:navigationController.view]; [self.window makeKeyAndVisible]; return YES; } In my RootViewController I am pushing another view onto the stack: //Show the deals DealViewController *dvc = [[DealViewController alloc] initWithNibName:@”DealViewController” bundle:nil]; [self.navigationController.navigationBar setHidden:NO]; […]

Adding UIBarButtonItem to UINav..Controller

i am not sure what i am missing here. I Have a custom UINavigationController and i am trying to add a persistant UIBarButtonItem to the bar. -(void)viewDidLoad { self.navigationBar.barStyle = UIBarStyleBlack; UIBarButtonItem *bbi = [[UIBarButtonItem alloc] initWithTitle:@”Nope…” style:UIBarButtonItemStyleBordered target:self action:@selector(goBack:)]; self.navigationItem.leftBarButtonItem =bbi; [bbi release]; } -(void)goBack:(id)sender { NSLog(@”go back now”); } what am i missing […]

How to replace current viewController with a new viewController

I’m trying to replace my current viewController with a new one. I’ve been able to do this before but I’m having some issues with BAD_ACCESS. This is the code that will run when I want to replace the current view with a new one. (The function will be called using a local property “self.some_data” (nonatomic, […]

creating back arrow shaped leftBarButtonItem on UINavigationController

I have a view with a navigation controller that I am showing modally and I want to add a back button that is shaped like the default left arrow buttons used in most splitViewControllers. I can create a basic button but I really want the left arrow shape – here is what i have now: […]

How to tell when back button is pressed in a UINavigationControllerStack

Is it possible to check when the back button is pressed in a UINavigationController stack? I’ve tried adding a action and target to self.navigationItem.backBarButtonItem to no avail. Anyone have any solutions?

Programmatically pressing a UITabBar button in Xcode

Sorry for the newbie question. I have a UITabBar in my main window view as well as an array of UINavigationControllers for each Tab. The structure is similar to the iPod app in that the main views can be seen by selecting TabBar items and then the user can drill down further with the NavigationController […]