tags:

views:

44

answers:

2

(Sorry, I restarted this thread as I incorrectly accepted the answer for my problem.)

My app is crashing when I navigate two view controllers in my application. For example, if I do this sequence:

RootController ViewControllerA ViewControllerB ViewControllerA

My app crashes.

It crashes when I pressed the back button in ViewControllerB. So, It seems like it is with two or more ViewControllers being pushed. Each by themselves work.

I don't know why.

I don't see any output to the console. Is there some type of debugging I should put?

I looked at the dealloc() to make sure all properties were being release before dealloc()

Any ideas?

Thank you.

A: 

Is your 2nd view controller holding a reference to the 1st without retaining it? If so, when your 2nd is dealloc'd it could release the 1st and cause it to have no references and be an invalid object.

bmalicoat
I am not sure what you mean by holding a reference to the 1st without retaining it? Do you have an example?
jp chance
In ViewControllerB if you have a pointer to ViewControllerA *viewControllerA and you don't call [viewControllerA retain] but in the dealloc method you do call [viewControllerA release] that will lower the retainCount and possibly make viewControllerA an invalid object. Does that make sense?
bmalicoat
A: 

I have this too. Nothing is being retained and released incorectly. It seems to just crash randomly. There is no way to reproduce it. It happens randomly and crashes inside apples code somewhere. It seems to happen more offten if I click faster through the nav bar veiws.

  • Sam
Sam