Category Archives: Code Snippets

Tip: Ensuring ARC is Enabled at Compile Time.

If you still have legacy code around that is not compiled with Automatic Reference Counting (ARC), accidentally adding some new code that assumes that ARC is enabled can lead to extensive memory leaks. This simple test, placed in a .m … Continue reading

Posted in Code, Code Snippets, Objective-C, Tips | Tagged , , | Leave a comment

Code Snippet: Decompressing a gzipped buffer.

The other day I was working with a web service that gzipped some of its replies. I needed something simple and robust that would gunzip an NSData without writing a file. When a little googling did not turn up a … Continue reading

Posted in Code Snippets | 1 Comment

Snippet: Playing a System Sound (ARC Version)

A minor change is needed to the “Playing a System Sound” code snippet. A __bridge modifier has to be added to the CFURLRef cast.

Posted in Code Snippets | Tagged , , , | 1 Comment