Error in UILabel

Discussion in 'iOS Programming' started by arnieterm, Jan 30, 2009.

  1. arnieterm macrumors regular

    Joined:
    Aug 28, 2008
    #1
    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
    
     
  2. jnic macrumors 6502a

    Joined:
    Oct 24, 2008
    Location:
    Cambridge
    #2
    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.
     
  3. arnieterm thread starter macrumors regular

    Joined:
    Aug 28, 2008
    #3
    I have used Try-Catch with breakpoint in it but it runs the entire code safely and crashes just after it
     
  4. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #4
    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.
     
  5. arnieterm thread starter macrumors regular

    Joined:
    Aug 28, 2008
    #5
    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
     
  6. arnieterm thread starter macrumors regular

    Joined:
    Aug 28, 2008
    #6
    I have attached the sample project that is using the Trebuchet MS font
     

    Attached Files:

  7. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #7
    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.
     

Share This Page