I have the following code to convert an NSSet to a comma separated line:
-(NSString *)toStringSeparatingByComma { NSMutableString *resultString = [NSMutableString new]; NSEnumerator *enumerator = [self objectEnumerator]; NSString* value; while ((value = [enumerator nextObject])) { [resultString appendFormat:[NSString stringWithFormat:@" %@ ,",value]];
It seems to work, but I get two warnings here:
1. format string is not a string literal (potentially insecure) 2. incompatible pointer types assigning to nsmutablestring from nsstring
How to rewrite it to avoid warnings?
source share