How to silence Xcode 4 warning “Semantic Issue: CFString literal contains NUL character”?-Collection of common programming errors

Here is one solution:

NSString *charSetStr = [NSString stringWithFormat: @"%C%C%C", 0, 10, 13];
illegalCharacters = [[NSCharacterSet characterSetWithCharactersInString:charSetStr] retain];

This way the string with NUL is not built until runtime and therefore no warnings from the compiler.