<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Objective-C on The Dangling Pointer</title><link>https://aaron.blog/tags/objective-c/</link><description>Recent content in Objective-C on The Dangling Pointer</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Tue, 17 Dec 2013 15:22:37 +0000</lastBuildDate><atom:link href="https://aaron.blog/tags/objective-c/index.xml" rel="self" type="application/rss+xml"/><item><title>NSNotificationCenter Block-based Observer</title><link>https://aaron.blog/nsnotificationcenter-block-based-observer-2/</link><pubDate>Tue, 17 Dec 2013 15:22:37 +0000</pubDate><guid>https://aaron.blog/nsnotificationcenter-block-based-observer-2/</guid><description>&lt;p&gt;Back in iOS 4, a nifty block-based observer method was added to NSNotificationCenter:&lt;br&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;code&gt;(id)addObserverForName:(NSString *)name object:(id)obj queue:(NSOperationQueue *)queue usingBlock:(void (^)(NSNotification *))block;&lt;/code&gt;&lt;br&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Super convenient, right? I love using blocks to pass simple callbacks to controllers instead of creating a delegate protocol. There is a catch with this method, and it's not terribly obvious unless you're looking closely. The method returns (id) - according to Apple's documentation the return object is "An opaque object to act as the observer".  What does this mean?&lt;/p&gt;</description></item><item><title>iOS Basics: nil vs NULL vs NSNull</title><link>https://aaron.blog/ios-basics-nil-vs-null-vs-nsnull/</link><pubDate>Wed, 23 Nov 2011 13:43:28 +0000</pubDate><guid>https://aaron.blog/ios-basics-nil-vs-null-vs-nsnull/</guid><description>&lt;p&gt;Yes, there are three ways to represent a null value in Objective-C.&lt;/p&gt;&lt;p&gt;NULL = Absence of a value with C-style pointers&lt;br&gt;nil = Absence of value with Objective-C object variables&lt;br&gt;NSNull = A nil boxed as an object for storage in a collection&lt;/p&gt;&lt;p&gt;If you try adding nil to a NSDictionary or NSArray, you will find out it doesn't perform as expected.  If you absolutely need to store a null value in a collection, you can use NSNull to represent the lack of a value.  For example:&lt;/p&gt;</description></item></channel></rss>