[iPhone 3.1] navigationItem.backBarButtonItem weirdness
[iPhone 3.1] navigationItem.backBarButtonItem weirdness
- Subject: [iPhone 3.1] navigationItem.backBarButtonItem weirdness
- From: John Michael Zorko <email@hidden>
- Date: Wed, 10 Feb 2010 16:10:49 -0800
Hello, all ...
I've a question about the UINavigationController backBarButtonItem property. I wanted to merely set my own image for the back button, instead of it using the title of the controller above in the hierarchy. So, this is what I did (yes this app is using Three20, but I don't think that's the reason):
- (id)initWithNavigatorURL:(NSURL *)URL query:(NSDictionary *)query
{
if (self = [super initWithNavigatorURL:URL query:query])
{
self.navigationItem.backBarButtonItem = [[[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"backarrow.png"] style:UIBarButtonItemStylePlain target:self action:@selector(back)] autorelease];
}
return self;
}
- (void)back:(id)sender
{
}
Now, this worked -- but I wasn't _expecting_ it to work. I was expecting that my "back" selector would be called, and I would have to tell the nav controller to pop. However, my "back" selector isn't called, and the back button _works_ like it always has. While i'm not in any way against freebees like this, i'm a bit concerned as to _why_ it works like this. Any explanation would be appreciated, explanations that actually edify me more so :-)
Regards,
John
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden