I'm kind of newbie in Objective-C and I need some help
My problem is that I have a subclass of UITextField
, and I want to set the placeholder font to be custom with this code
- (void)drawPlaceholderInRect:(CGRect)rect {
[[self placeholder] drawInRect:rect withAttributes:@{NSFontAttributeName: [UIFont fontWithName:@"Georgia Belle" size:25],NSForegroundColorAttributeName:RGBA(174, 150, 108, 1)}]; }
and I have the next issue. When I select iPad in the simulator, and I compile the program, everything goes as it should, but when I select a retina device I get the next Exception:
[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0].
What I'm asking is: why it works on non-retina but throws exceptions on retina, any kind of retina device.