And, in the viewDidAppear I called the viewDidLoad method (where there is the instantiation of ARView).
But when the user touch the screen after turning the controller (setting the new rootViewController), app crashes with this error:
0x20ed68: ldrb.w r0,
0x20ed6c: bx lr
How can I solve this error?
over 7 years ago
Hi Luca, Setting a new rootViewController while your application is running might not be the best idea. I don't know what else your application is doing but you should present additional view controller either with usage of navigation controller, tab controller or your own custom container controller impl. Depending on your view controller management you shouldn't nil out the architect view by yourself but let the view controller do that. defining a strong property for the architect view is fine and in your view controllers dealloc method, the architect view will be deleted. You just have to make sure that the view controller, who is responsible for the architect view, is deleted correctly.
For me it's not that easy to write a perfect answer here, but you should think about your view controller management. It seems that you're using them in a way that is not inteded by the iOS SDK.
Also calling viewDidLoad from within viewDidAppear is really not a good idea!
You could read some tutorials about iOS development and how to use view controllers best.
The problem right now seems that you have some view controller/architect view garbage in memory that crashes because it's still somehow referenced.
over 7 years ago
Ok thanks, I solved with a simple -presentViewController
I used the rootViewController property because I was thinking that in this way controller will be definitely deallocated.