0

I'm relatively new to iOS programming. I 've made some apps to the 6.0 emulator and I tried to run them in the 5.1 emulator.

They all crash in [self.window makeKeyAndVisible]; in appdelegate.mm didFinishLaunchingWithOptions. Note that I had to enable "add exception breakpoint" for this to show up.

  1. Where can I see a crash log in xcode?
  2. Can I tell xcode to warn me on new APIs ? I found in a similar question the snippet in the PCH but I 'm not sure what to put in order to work.
  3. I understand that the problem may occur because of an error in the XIB file. How can I detect these possible errors?

Edit: Yes I started with an empty XIB and it doesn't crash.So it must be a XIB error. How can I detect what sort of errors they might be? I removed all connections/outlets from a simple xib with 1 image and 2 buttons - still crash.

M.

Community
  • 1
  • 1
Michael Chourdakis
  • 10,345
  • 3
  • 42
  • 78

2 Answers2

2

It sounds like an exception has been thrown. You need to see what the exception is by looking in the console in Xcode. It should appear at the bottom of the middle section when something gets logged there. Exceptions are logged there.

With regard to warning about "too new" APIs, try my header you can grab here. Just download it, add it to your project and #import it in your PCH file right at the top.

You can't really detect the errors that easily. You need to just be careful really. The best way of detecting errors is to just test.

mattjgalloway
  • 34,792
  • 12
  • 100
  • 110
  • Thanks. Using your help I was able to get the exception information in the console,and http://cdrussell.blogspot.gr/2012/07/could-not-instantiate-class-named.html helped me understand that thesolution was to remove the "auto layout" feature. – Michael Chourdakis Oct 23 '12 at 20:25
1

As Michael posted in the comment, if you've created the project for iOS 6 and then you changed the deployment target to 5.1, it's the Autolayout from the .xibs.

Open each .xib, click on 'Show Utilities' button (3rd from the view group), then go to 'Show File Inspector' (first tab), tick off 'Use Autolayout' and change Deployment to 5.1. (see attached screenshot).

Tick off Use Autolayout

Also check the link: http://cdrussell.blogspot.gr/2012/07/could-not-instantiate-class-named.html

Marius
  • 3,589
  • 3
  • 27
  • 30