Getting strange debugger message: Assertion failed: (cls), function getName: what is this?

前端 未结 6 812
一生所求
一生所求 2021-02-01 17:47

Since I upgraded from Xcode 3.2.3 to 3.2.4 and iOS 4.0.1 to iOS 4.1 SDK, when I set a breakpoint in my code and single-step over instructions, at each step, the debugger will sp

6条回答
  •  清酒与你
    2021-02-01 18:17

    I'm having a similar problem, but mine is with creating a custom view with Core Text in it. As soon as my view's drawRect calls the line

    CTFontRef titleFont = CTFontCreateWithName(CFSTR("Baskerville"), 40.0f, NULL); 
    

    It hangs the app, whether in the simulator or on the device. Bizarrely, I can rectify this by alloc-initing another UIKit text component in the View Controller's viewDidLoad method... I don't even have to add it as a subview. It's like it needs some common text elements loaded before Core Text can load in fonts.

    - (void)viewDidLoad
    {
        [super viewDidLoad];
        UILabel *l = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 0, 0)];        
    }
    

    Weird.

提交回复
热议问题