<?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>Notifications on The Dangling Pointer</title><link>https://aaron.blog/tags/notifications/</link><description>Recent content in Notifications 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/notifications/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></channel></rss>