Closed vitalybaev closed 9 years ago
EXC_BAD_ACCESS
check the type of the number
variable: since you formatting it as "%@"
, it should be NSNumber
Thanks! Now this code works:
NSNumber *number = [NSNumber numberWithInt:42];
NSString *format = SLPluralizedString(@"%d apples", number, @"Comment");
NSString *text = [NSString stringWithFormat:format, number];
But in your README.md I found this code, that crashes an app:
int number = 42;
NSString *format = SLPluralizedString(@"%d apples", number, @"Comment");
NSString *text = [NSString stringWithFormat:format, number];
@vitalybaev check your format strings, xcode is not highlighting errors in this case
%@
to format NSObject
s (NSNumber
)
%d
to format integers (NSInteger
, int
)
bitcode issue fixed
Hi, I'v start using your project, installed via CocoaPods, created sample project and run an app. But simple function
[NSString stringWithFormat:SLPluralizedString(@"%@ apples", number, nil), number]
terminates app with EXC_BAD_ACCESSDemo project works well in simulator, but failing compile cause