Reputation:
Hi I have this strange issue when I change Device from Hardware menu, but I think I maybe missing something simple.
I have this code in my view controller:
- (void)touchesBegan:(NSSet *)touches
withEvent:(UIEvent *)event
{
// Just logging some values
NSLog(@"%@ %@ %@", NSStringFromCGRect([[UIScreen mainScreen] bounds]), NSStringFromCGRect(self.view.frame), NSStringFromCGRect([[UIScreen mainScreen]applicationFrame]));
}
When I run initially all works fine. And logs are printed when I click on the view controller's view.
But, if I go to Hardware menu and choose: Hardware -> Device -> iPhone (Retina 3.5 inch)
What happens first is my app gets minimized/closed (should it happen like that?).
Then, from the simulator I need to find the icon of my app and launch it from the beginning.
Now, when I click the view of my View Controller logs aren't displayed anymore. What can I be doing wrong?
Upvotes: 0
Views: 42
Reputation: 108149
When you change hardware device the app is being killed. Doing so will end the debug session, detaching the app from Xcode.
Long story short, when you change the simulator hardware device you have to run the application again from Xcode.
Upvotes: 2