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

akesson

macrumors newbie
Original poster
Oct 22, 2010
7
0
Hey!

I have created a UIToolbar and three (toolbar)buttons in my applications appdelegate. I also have two views, both of the views shows the toolbar and the same three buttons. One of the buttons have a specific action for each view.

It all works fine for the buttons that have the same action. However when I do a special scenario the app crashes.

Here's the scenario:

View 1:
Push the button, works fine.

Push to View 2 (from View 1):
Push the same button, works fine:

Pop back to View 1 (from View 2):
Push the same button, crash boom bang!

I used the debugger to find where it crashes:
Code:
[toolbar setItems:buttons animated:YES];

I've also enabled NSZombies. Here's what it says when I press the button and it crashes:
Code:
[SecondViewController performSelector:withObject:withObject:]: message sent to deallocated instance 0x5a5ba00

Here's what I do to reassign the action (if it matters):
Code:
[appDelegate.fullscreenButton setTarget:self];
[appDelegate.fullscreenButton setAction:@selector(fullscreenButtonTapped: )];

I cant get me head around what's wrong.

Thanks in advanced!
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.