stringWithFormat should return a string, why does this statement not compile
NSAssert(YES, [NSString stringWithFormat:@"%@",@"test if compiles"]);
when
NSAssert(YES, @"test if compiles");
compiles?
Use this as :
NSAssert(YES, ([NSString stringWithFormat:@"%@",@"test if compiles"])); // Pass it in brackets ()
Hope it helps you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With