samedi 25 avril 2015

Xcode 6.3 (and 6.2) hits breakpoint on [UIFont fontWithName: size:]


In My iOS Application im using a class (DKTheme) to keep my fonts and images in a centralised place. my implementation looks like this.

+ (instancetype)theme {
    static DKTheme *_theme = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        _theme = [[DKTheme alloc] init];
    });
    return _theme;
}

- (id)init {
    self = [super init];
    if (self) {
        [self setupTheme];
    }
    return self;
}

- (void)setupTheme {
// some code here
self.smallButtonFont = [UIFont fontWithName:@"Helvetica-Bold" size:13.0f];
//some code here
}

And when i run this code in device (iPhone 5C, iOS8.3 and iOS8.2), xcode hits breakpoint on the line self.smallButtonFont = [UIFont fontWithName:@"Helvetica-Bold" size:13.0f]; if i click continue execution button, application continue running without crashing and my font property(self.smallButtonFont) is successfully initialised.

Breakpoint

Call Stack

and i noticed one more thing, i have several [UIFont fontWithName: size:]; calls and breakpoint hits only first time call.(if i comment the first one then next method call hits the break point). it is really annoying this breakpoint issue, any help would be thankful.


Aucun commentaire:

Enregistrer un commentaire