I am pretty much loading up a setup view. I am doing that by making "Setup" its own XIB (thats how I want it), then animating it on screen by using UIView animations. I am a little bit in a dilemma here on top of having a crash because if I am loading up this XIB as a subview in say my "TestViewController", and my done method which slides the subview off screen is in my "Setup" view controller, would I just do [self.view removeFromSuperView]; ?
That was my first question/dilemma.
Now the reason I made this thread was because it is crashing in that done method in my setup view controller.
Here is the console log on why it is crashing...
Code:
-[NSPathStore2 doneSetup]: unrecognized selector sent to instance 0x299130
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSPathStore2 doneSetup]: unrecognized selector sent to instance 0x299130'
*** First throw call stack:
That was fast. Anyways it looks like a memory problem because you are messaging a NSPathStore object. Obviously it doesn't have that method so it's crashing.
It's a zombie. Your object is either not being retained or you've inadvertently released it too early. Most likely you just never retained it though.
Yea I would say so too because if I take away a memory hogging feature in that view, the app still crashes with EXC_BAD_ACCESS. And what object would are we talking about here?
The object is a UIButton so you are saying the crash is because of the UIButton itself? If so, is it crashing because I am removing it from the superview?
-[NSPathStore2 doneSetup]: unrecognized selector sent to instance 0x299130
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSPathStore2 doneSetup]: unrecognized selector sent to instance 0x299130'
*** First throw call stack:
The crash is because "doneSetup" is getting sent to NSPathStore2, instead of to your object that actually implements "doneSetup". The reason is because you under-retained or over-released your object and it got deallocated, but you're still holding a pointer to it somewhere. And so when you sent the "doneSetup" message to that pointer, it was sent to a different object than you thought the pointer pointed to.
__________________ Recall It!Tag your notes. Tag your photos. Tag your thoughts. Tag your life.
Not sure what you mean by "has". What would have the method in my case? Is there anything wrong with the code I posted? Do you see anything wrong with it?
You probably think I'm a noob but I have been coding for 1+ year so I somewhat know what I am doing here.
Ok well the class name is Setup.m, so it has to be an object inside of it, right? NSZombie is only returning what I posted. I am not using allocations/leaks instrument because I don't think I need to.
You haven't set the button as a property of the UIViewController (nonatomic, retain), so it is never retained. I presume that the UIButton is declared as
Code:
[UIButton buttonWithType]
And therefore you are given a unretained, autoreleased UIButton. Make the UIButton a property with the attributes given above and you won't get this error.
The button is created in IB and is not made programmatically.
I tried what you said anyway, and I get EXC_BAD_ACCESS in that same line in my last post with code.
Even if I comment everything out of the method, it stills crashes with SIGABRT, I have no idea why. I have never seen anything like this before.
It has something do with the class itself, so it looks like I understand more whats going on but still no idea how to fix it. Also if I click anything in the view, it crashes. Why?
Also this is how I present the view, if that makes a difference...