{"id":3882,"date":"2014-03-30T06:10:43","date_gmt":"2014-03-30T06:10:43","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/how-to-silence-xcode-4-warning-semantic-issue-cfstring-literal-contains-nul-character-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:42:26","modified_gmt":"2022-08-30T15:42:26","slug":"how-to-silence-xcode-4-warning-semantic-issue-cfstring-literal-contains-nul-character-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/how-to-silence-xcode-4-warning-semantic-issue-cfstring-literal-contains-nul-character-collection-of-common-programming-errors\/","title":{"rendered":"How to silence Xcode 4 warning &ldquo;Semantic Issue: CFString literal contains NUL character&rdquo;?-Collection of common programming errors"},"content":{"rendered":"<p>Here is one solution:<\/p>\n<pre><code>NSString *charSetStr = [NSString stringWithFormat: @\"%C%C%C\", 0, 10, 13];\nillegalCharacters = [[NSCharacterSet characterSetWithCharactersInString:charSetStr] retain];\n<\/code><\/pre>\n<p>This way the string with NUL is not built until runtime and therefore no warnings from the compiler.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here is one solution: NSString *charSetStr = [NSString stringWithFormat: @&#8221;%C%C%C&#8221;, 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.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,1],"tags":[],"class_list":["post-3882","post","type-post","status-publish","format-standard","hentry","category-semantic","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3882","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=3882"}],"version-history":[{"count":1,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3882\/revisions"}],"predecessor-version":[{"id":8762,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3882\/revisions\/8762"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=3882"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=3882"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=3882"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}