An argument of my dictionary looks to be nil but i have no idea why... I've browsed SOF and all propositions are like this.
CGSize size;
if ([[[UIDevice currentDevice] systemVersion]
compare:@"7.0" options:NSNumericSearch] == NSOrderedAscending) {
// here it works
size = [string sizeWithFont:[UIFont fontWithName:@"HelveticaNeue-Italic"
size:15.0f]];
} else {
// here it crashes
size = [string sizeWithAttributes:
[NSDictionary dictionaryWithObject:[UIFont fontWithName:@"HelveticaNeue-Italic"
size:15.0f] forKey:NSFontAttributeName]];
}
// console output
*** Terminating app due to uncaught exception 'NSInvalidArgumentException',
reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]:
attempt to insert nil object from objects[0]'