Pamy
Pamy

Reputation: 193

ios methods becoming zombies

I added uiviewcontroller subclass in my arc enabled project, i added a button created the ibaction for it and inside it contains no code, all done through interface builder no manual code, but when i am tapping the button i am getting exc_bad_acess. Instrumentation saying its a zombie attack when pressing button. I really dont understand whats going wrong. I created the new project and done the same thing it is working perfectly. Same thing happening when i am defining method to dismiss keyboard (resign first responder).

this generated when i crtl+dragged from button to interface implementation, i choose the ibaction and name and this code is generated.

- (IBAction)pushh:(id)sender;

and the implementation inside .m file

- (IBAction)pushh:(id)sender {
}

thats all ...

Upvotes: 0

Views: 115

Answers (2)

eliyahu
eliyahu

Reputation: 1

My solution was to delete the button iboutlet in ib, also delete the ibaction in ib, and then connect it back.

Upvotes: 0

Rob
Rob

Reputation: 438122

Just to wrap up the offline conversation, a couple of thoughts:

  1. Your zombie is undoubtedly a result of the ecnObj falling out of scope. If it's an ivar of the view controller, then that premature release problem goes away.

  2. You do not want to create a new view controller and then use its view in transitionFromView. If you want to transition between view controllers (in iOS5) you should use pushViewController or presentViewController (or if you're using a container view controller, you can pursue transitionFromViewController). See View Controller Programming Guide's discussion of "Presenting View Controllers from Other View Controllers".

Upvotes: 1

Related Questions