Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

nomar383

macrumors 65816
Original poster
Jan 29, 2008
1,310
0
Rexburg, ID
Just a quick question:

I have moved all of my current project's data into a standard "Utility Application" (Just a new Utility app in Xcode). How do I change the title bar on the "flipside" view controller. It seems to be using my projects name and I have no idea how to override it with what I want.

I have tried:
Code:
self.title = @"Credits";
in the FlipSideViewController class in the viewDidLoad method, but it still will not change. This same code does work in my mainViewController method (although that viewController specifically has a Navigation bar at the top). What's up?
 

dejo

Moderator emeritus
Sep 2, 2004
15,982
452
The Centennial State
I do the following in my loadFlipsideViewController:
Code:
UINavigationItem *navigationItem = [[UINavigationItem alloc] initWithTitle:@"About app"];
[flipsideNavigationBar pushNavigationItem:navigationItem animated:NO];
 

nomar383

macrumors 65816
Original poster
Jan 29, 2008
1,310
0
Rexburg, ID
Cool, where would I put this in the code? And I'm guessing I have to release that *navigationItem somewhere?

EDIT: I read the post again and know where to put it now lol. Can I release this object in the "dealloc" method?

EDIT2: I actually didn't have to change anything but the initWithTitle: (it was all already there). I just didn't notice it in my code examination. Thanks a lot!
 

nomar383

macrumors 65816
Original poster
Jan 29, 2008
1,310
0
Rexburg, ID
Another question about the a utility-based app. When I tap the little "i" in the simulator, it reacts perfectly. However, when my app is installed on an actual iPhone, I have to hit that "i" button several times before it will respond. Any ideas?

Here is the standard Apple code that was inluded when the button is pressed:

Code:
- (IBAction)toggleView {    
    /*
     This method is called when the info or Done button is pressed.
     It flips the displayed view from the main view to the flipside view and vice-versa.
     */
    if (flipsideViewController == nil) {
        [self loadFlipsideViewController];
    }
    
    UIView *mainView = mainViewController.view;
    UIView *flipsideView = flipsideViewController.view;
    
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:1];
    [UIView setAnimationTransition:([mainView superview] ? UIViewAnimationTransitionFlipFromRight : UIViewAnimationTransitionFlipFromLeft) forView:self.view cache:YES];
    
    if ([mainView superview] != nil) {
        [flipsideViewController viewWillAppear:YES];
        [mainViewController viewWillDisappear:YES];
        [mainView removeFromSuperview];
        [infoButton removeFromSuperview];
        [self.view addSubview:flipsideView];
        [self.view insertSubview:flipsideNavigationBar aboveSubview:flipsideView];
        [mainViewController viewDidDisappear:YES];
        [flipsideViewController viewDidAppear:YES];

    } else {
        [mainViewController viewWillAppear:YES];
        [flipsideViewController viewWillDisappear:YES];
        [flipsideView removeFromSuperview];
        [flipsideNavigationBar removeFromSuperview];
        [self.view addSubview:mainView];
        [self.view insertSubview:infoButton aboveSubview:mainViewController.view];
        [flipsideViewController viewDidDisappear:YES];
        [mainViewController viewDidAppear:YES];
    }
    [UIView commitAnimations];
}

Looks fine to me. I played around in Interface Builder and all appears peachy there as well...

EDIT: wtf as soon as I change the icon to "Detail Disclosure" instead of the "i", it works fine. Ugh. I guess that's what I'll use then!
 

dejo

Moderator emeritus
Sep 2, 2004
15,982
452
The Centennial State
If you aren't satisfied with the tap area for the 'i', perhaps place a transparent custom button in front of it that calls the same action and enlarges the tap area.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.