In My iOS application, I use the (DKTheme) class to keep fonts and images in a centralized location. 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 on the device (iPhone 5C, iOS8.3 and iOS8.2), xcode hits the breakpoint on the line self.smallButtonFont = [UIFont fontWithName:@"Helvetica-Bold" size:13.0f]; , if I click the continue button, the application continues to work without failures and the font property ( self.smallButtonFont ) is successfully initialized.


and I noticed one more thing: I have several calls [UIFont fontWithName: size:]; , and the breakpoint is only the first time. (if I comment on the first, and then the next method call hits the breakpoint). it really annoys this checkpoint problem, any help would be appreciated.
ios objective-c iphone xcode xcode6
Chathuranga jayawardhana
source share