{"id":78,"date":"2008-07-05T20:13:51","date_gmt":"2008-07-06T01:13:51","guid":{"rendered":"http:\/\/vgable.com\/blog\/2008\/07\/05\/fourcharcode2nsstring\/"},"modified":"2008-08-05T23:46:42","modified_gmt":"2008-08-06T04:46:42","slug":"fourcharcode2nsstring","status":"publish","type":"post","link":"https:\/\/vgable.com\/blog\/2008\/07\/05\/fourcharcode2nsstring\/","title":{"rendered":"FourCharCode2NSString"},"content":{"rendered":"<p>As I have <a href=\"http:\/\/vgable.com\/blog\/2008\/04\/23\/printing-a-fourcharcode\/\">written before<\/a>, the best way to convert a <code>FourCharCode<\/code> to an <code>NSString*<\/code> for <code>NSLog()<\/code>ing is to use the <code>NSFileTypeForHFSTypeCode()<\/code> function.  <strong>But for the life of me I can&#8217;t remember that name<\/strong>, even though I use it about once a month.  It&#8217;s too long, and it has too little to do with what I&#8217;m using it for.<\/p>\n<p>So I have added the line:<br \/>\n<code>#define FourCharCode2NSString(err)\tNSFileTypeForHFSTypeCode(err)<\/code><br \/>\nTo my prefix-files, because I <em>can<\/em> remember <code>FourCharCode2NSString()<\/code>.<\/p>\n<p>UPDATE: (2008-08-06) There is <a href=\"http:\/\/vgable.com\/blog\/2008\/08\/05\/simpler-logging-2\/\">an even easier way<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As I have written before, the best way to convert a FourCharCode to an NSString* for NSLog()ing is to use the NSFileTypeForHFSTypeCode() function. But for the life of me I can&#8217;t remember that name, even though I use it about once a month. It&#8217;s too long, and it has too little to do with what [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,5,4,13,8],"tags":[77,79,80,78],"class_list":["post-78","post","type-post","status-publish","format-standard","hentry","category-macosx","category-objective-c","category-programming","category-sample-code","category-usability","tag-debugging","tag-fourcharcode","tag-macros","tag-nsstring"],"_links":{"self":[{"href":"https:\/\/vgable.com\/blog\/wp-json\/wp\/v2\/posts\/78","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vgable.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vgable.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vgable.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vgable.com\/blog\/wp-json\/wp\/v2\/comments?post=78"}],"version-history":[{"count":0,"href":"https:\/\/vgable.com\/blog\/wp-json\/wp\/v2\/posts\/78\/revisions"}],"wp:attachment":[{"href":"https:\/\/vgable.com\/blog\/wp-json\/wp\/v2\/media?parent=78"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vgable.com\/blog\/wp-json\/wp\/v2\/categories?post=78"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vgable.com\/blog\/wp-json\/wp\/v2\/tags?post=78"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}