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

arnieterm

macrumors regular
Original poster
Aug 28, 2008
201
0
Hi
I am getting the below given error when run an app on iphone device. The screens are created in IB. I am using Trebuchet MS font [Regular, Bold,Italic]
is it due to any UILabel becoming corrupt? Through code I am not using setFont.
Any idea?
Code:
2009-01-30 14:54:47.492 Shoofa[1008:20b] *** Assertion failure in -[UILabel setFont:], /SourceCache/UIKit/UIKit-747.36/UILabel.m:438
2009-01-30 14:54:47.500 Shoofa[1008:20b] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: font != nil'
2009-01-30 14:54:47.510 Shoofa[1008:20b] Stack: (
    808221155,
    806100820,
    808035755,
    812497771,
    817194548,
    818005340,
    816291648,
    836031656,
    836031416,
    836029236,
    836028412,
    807837997,
    807836001,
    807834471,
    827655876,
    816145636,
    816184028,
    8381,
    8244
)
terminate called after throwing an instance of 'NSException
 

jnic

macrumors 6502a
Oct 24, 2008
567
0
Cambridge
Set some breakpoints and step through to see the line that's causing you the crash, then paste it here so we can see what you're doing.
 

arnieterm

macrumors regular
Original poster
Aug 28, 2008
201
0
I have used Try-Catch with breakpoint in it but it runs the entire code safely and crashes just after it
 

PhoneyDeveloper

macrumors 68040
Sep 2, 2008
3,114
93
If you set a breakpoint on objc_exception_throw the debugger will break before the exception/Assertion is thrown and you'll have a useful backtrace. I do this with a .gdbinit file. Create a file named .gdbinit and place it in your home directory. This is the contents of mine:

fb -[NSException raise]
fb -[_NSZombie release]
fb szone_error
fb objc_exception_throw

It's also possible to set these kinds of breakpoints in the Xcode breakpoints window or in the debugger console.

This will help you to track down this, and other, bugs. Possibly the font you've chosen in IB doesn't really exist on the device or possibly there is a mistake in IB related to this font. You might try another font.
 

arnieterm

macrumors regular
Original poster
Aug 28, 2008
201
0
I have created a very simple iphone project that contains only one UILabel with Trebuchet MS font [Bold]. When I use regular it shows up but when I use bold, bolditalic it doesn't. The other details are given below:
Xcode:3.1.2
Mac OS X: 10.5.4
iphone OS and simulator settings on which i tried to run this project
Device -iPhone OS 2.0
Device -iPhone OS 2.1
Device -iPhone OS 2.2
Simulator -iPhone OS 2.0
Simulator iPhone OS 2.1
Simulator iPhone OS 2.2

Though this sample project created by me does not hangs but it does not show up the label
Can anybody point out what is going wrong
 

arnieterm

macrumors regular
Original poster
Aug 28, 2008
201
0
I have attached the sample project that is using the Trebuchet MS font
 

Attachments

  • InterfaceBuilderTut.zip
    491.3 KB · Views: 76

dejo

Moderator emeritus
Sep 2, 2004
15,982
452
The Centennial State
I have created a very simple iphone project that contains only one UILabel with Trebuchet MS font [Bold]. When I use regular it shows up but when I use bold, bolditalic it doesn't
I've tried this too and, you're right, it doesn't show up. I really think this might be a bug. You should submit this to Apple.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.