Crash in release mode when generating NSString with arguments
I wrote a log helper class that has a couple of log functions. Everything works well in DEBUG mode. But when I run my code it is release mode it crashes. Below is the code snippet:
+ (void)info:(NSString *)format, ...
{
va_list args;
va_start(args, format);
va_end(args);
NSString *formatedMessage = [[NSString alloc] initWithFormat:[NSString stringWithFormat:@"INFO %@",format] arguments:args];
}
The formatedMessage fails when using the below:
If I installed
Build setting-> optimization level to NONE
in release mode, everything runs smoothly. Any idea to fix it with an optimization level
fastest smallest
in release mode
+3
source to share
1 answer