Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

detz

macrumors 65816
Original poster
Jun 29, 2007
1,051
0
The organizer shows you the device console, which is stored in a log file. It's the tab at the top next to crash Logs. That's what I meant by 'console for the device' as opposed to the debugger console.

Wow, I never knew that was there! ;-) Thanks.

Here is what is says, it appears it's crashing from within one of Apple's libraries?

Thu Jun 11 21:36:44 unknown iOwn[691] <Warning>: *** Assertion failure in -[UILabel setFont:], /SourceCache/UIKit/UIKit-747.38/UILabel.m:443
Thu Jun 11 21:36:44 unknown iOwn[691] <Error>: *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: font != nil'
Thu Jun 11 21:36:44 unknown iOwn[691] <Error>: Stack: (
808221155,
806100816,
808035743,
812495815,
817179720,
818002800,
816266204,
836591856,
836591616,
836589428,
836588604,
807837933,
807835937,
807834407,
827752032,
816118388,
816157144,
8343,
8244
)
Thu Jun 11 21:36:44 unknown UIKitApplication:com.FifthFloorMedia.iOwn[0x6379][691] <Notice>: terminate called after throwing an instance of 'NSException'
 

Attachments

  • Picture 1.png
    Picture 1.png
    27 KB · Views: 72

PhoneyDeveloper

macrumors 68040
Sep 2, 2008
3,114
93
Well, it says that the font that's being set is nil. That causes the assertion failure and the app then get's killed.

Are those two lines about the NSIndexPath from NSLogs in your code?

This will not be easy to debug since you can't make it crash in the debugger.

Overall here's what I think is happening based on the crash log and these console messages. I assume this is at app startup. Your first screen is being loaded. Does anything appear and then it crashes or is it while your Default.png is still visible? A font is set for a button in your code. At a shortly later time the view hierarchy is being set up or adjusted, you can see [UIButton layoutSubviews] in the stack trace. For some reason the font doesn't exist and fontWithName has returned nil. If you have hard-coded the names of any fonts they might not exist. If you are using nibs check the fonts that you're using for buttons in the nibs.

The exact process of how the UIKit classes set themselves up obviously isn't documented so we can only make guesses based on the stack trace but it seems like something like this has happened. This is why it's failing in the Apple UIKit library. But most likely it's caused by something that your code or nib has done earlier.
 

detz

macrumors 65816
Original poster
Jun 29, 2007
1,051
0
Well, it says that the font that's being set is nil. That causes the assertion failure and the app then get's killed.

Are those two lines about the NSIndexPath from NSLogs in your code?

This will not be easy to debug since you can't make it crash in the debugger.

Overall here's what I think is happening based on the crash log and these console messages. I assume this is at app startup. Your first screen is being loaded. Does anything appear and then it crashes or is it while your Default.png is still visible? A font is set for a button in your code. At a shortly later time the view hierarchy is being set up or adjusted, you can see [UIButton layoutSubviews] in the stack trace. For some reason the font doesn't exist and fontWithName has returned nil. If you have hard-coded the names of any fonts they might not exist. If you are using nibs check the fonts that you're using for buttons in the nibs.

The exact process of how the UIKit classes set themselves up obviously isn't documented so we can only make guesses based on the stack trace but it seems like something like this has happened. This is why it's failing in the Apple UIKit library. But most likely it's caused by something that your code or nib has done earlier.

Well, it doesn't crash on open. I can use the app up until the same point, if I try to move from one screen to the next it crashes. At least this part is consistent. I've grep'ed my source files and the fonts I'm setting are

Helvetica-Bold
Helvetica-Italics
Helvetica
italicSystemFontOfSize

So I'm guessing it's not that. Also, it's odd because these didn't change, if anything I would expect it to crash 3.0 because something was removed but not the other way around.

I found one font that has been removed in 3.0 that was there in 2.x but that shouldn't matter(yet). What sucks is it doesn't crash for me so I have no way of testing. My guess is it's using the libraries I currently have installed(3.0) but when it goes on an actual phone through the store it doesn't have those since they are on the phone. Something that is being used with I compile doesn't exist on the current version.
 

PhoneyDeveloper

macrumors 68040
Sep 2, 2008
3,114
93
Given that this failure happens when a particular screen is being shown I'd look over the code that builds buttons and sets fonts for that screen very carefully. I would step through that code and inspect all the fonts closely. Maybe you get a nil font but the runtime exception isn't thrown in one case but is in another.

When you say the test code is the same as the version from apple I assume that means you're checking a release build.

It might be possible for gdb to attach to an app running on the phone. I really don't know. There is a menu item in Xcode for 'attach to process' but the processes are all on the Mac. There might be a way to attach to a process running on the phone but I don't know how. If you could do that you could debug the app that you know fails.
 

Macman1993

macrumors 6502
Nov 23, 2007
337
16
AHH WTF YOUR APP KEEPS CRASHING FOR ME!!!!!

Sorry man couldn't help myself there I don't actually own your app but I really like the idea and I'll get it in 10 min. I think what apple did to you totally sucks, granted you did submit the error but when they put your app on the pedestal they should at least make sure it works as not to kill your ratings.
 

imPoddible

macrumors member
Jul 13, 2008
42
0
Did you manage to fix this issue in the end?

The possibility of a fonts issue has got me paranoid.

I've been building an update to my app in 2.x SDK without any probs. Then, a couple of days ago I updated to the 3.1.3 GM SDK.

However, I now notice when I build, I get some font related warnings (not errors):

Warning: 'setFont:' is deprecated (declared at /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0.sdk/System/Library..."

Warning: 'setText:' is deprecated (declared at /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0.sdk/System/Library..."


Is this anything to worry about?

I don't want to build with this version and release an update which then starts crashing all over the place!

Cheers,

imPoddble.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.