Start a new topic

ArchitectEngine::wasScreenTouched() const

ArchitectEngine::wasScreenTouched() const

Hi everyone.

I have a menu in AR where the user can select the page where he wants to go. So, when he clicked the option, I use this command to present the controller:

.self.window.rootViewController = selectedOptionController;

In the viewDidDisappear of ARController I did:

self.architectView = nil;

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:

Hermes`ArchitectEngine::wasScreenTouched() const:

0x20ed68:  ldrb.w r0,

0x20ed6c:  bx     lr

0x20ed6e:  nop


How can I solve this error?

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.

Best regards


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.

-presentViewController sounds a lot better! ;)

Best regards

Login or Signup to post a comment