<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>NSBlog</title><link>http://www.mikeash.com/pyblog/</link><description>Mac OS X and Cocoa programming</description><lastBuildDate>Thu, 02 Sep 2010 23:06:22 GMT</lastBuildDate><generator>PyRSS2Gen-1.0.0</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Friday Q&amp;amp;A 2010-08-27: Defensive Programming in Cocoa
</title><link>http://www.mikeash.com/pyblog/friday-qa-2010-08-27-defensive-programming-in-cocoa.html</link><description>Welcome back to another word-laden edition of Friday Q&amp;amp;A. About a year ago, I wrote &lt;a href="friday-qa-2009-10-09-defensive-programming.html&amp;gt;a post on defensive programming&amp;lt;/a&amp;gt;. That post covered defensive programming in a general sense, and Scott Gould has requested that I write one specific to various standard Cocoa practices, which is what I will be talking about today.&amp;lt;/p&amp;gt;

&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Recap&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;
Defensive coding essentially boils down to constantly asking yourself, "&gt;a post on defensive programming&lt;/a&gt;. That post covered defensive programming in a general sense, and Scott Gould has requested that I write one specific to various standard Cocoa practices, which is what I will be talking about today.&lt;br&gt;&lt;a href="http://www.mikeash.com/pyblog/friday-qa-2010-08-27-defensive-programming-in-cocoa.html"&gt;(Read More)&lt;/a&gt;</description><guid isPermaLink="true">http://www.mikeash.com/?page=pyblog/friday-qa-2010-08-27-defensive-programming-in-cocoa.html</guid><pubDate>Fri, 27 Aug 2010 15:19:00 GMT</pubDate></item><item><title>Friday Q&amp;amp;A 2010-08-12: Implementing NSCoding
</title><link>http://www.mikeash.com/pyblog/friday-qa-2010-08-12-implementing-nscoding.html</link><description>Welcome back to another frightening edition of Friday Q&amp;amp;A. This time around, friend and local OS X coder &lt;a href="http://www.littlemustard.com/"&gt;Jose Vazquez&lt;/a&gt; has suggested that I discuss how to implement &lt;code&gt;NSCoding&lt;/code&gt; in Objective-C classes.&lt;br&gt;&lt;a href="http://www.mikeash.com/pyblog/friday-qa-2010-08-12-implementing-nscoding.html"&gt;(Read More)&lt;/a&gt;</description><guid isPermaLink="true">http://www.mikeash.com/?page=pyblog/friday-qa-2010-08-12-implementing-nscoding.html</guid><pubDate>Fri, 13 Aug 2010 16:35:00 GMT</pubDate></item><item><title>Friday Q&amp;amp;A 2010-07-30: Zeroing Weak References to CoreFoundation Objects
</title><link>http://www.mikeash.com/pyblog/friday-qa-2010-07-30-zeroing-weak-references-to-corefoundation-objects.html</link><description>It's time for another friendly edition of Friday Q&amp;amp;A. For my last Friday Q&amp;amp;A, I talked about &lt;code&gt;MAZeroingWeakRef&lt;/code&gt; and how it's implemented for pure Objective-C objects. For this one, I'm going to discuss the crazy hacks I implemented to make it work with toll-free bridged CoreFoundation objects as well.&lt;br&gt;&lt;a href="http://www.mikeash.com/pyblog/friday-qa-2010-07-30-zeroing-weak-references-to-corefoundation-objects.html"&gt;(Read More)&lt;/a&gt;</description><guid isPermaLink="true">http://www.mikeash.com/?page=pyblog/friday-qa-2010-07-30-zeroing-weak-references-to-corefoundation-objects.html</guid><pubDate>Fri, 30 Jul 2010 19:01:00 GMT</pubDate></item><item><title>Introducing MAZeroingWeakRef
</title><link>http://www.mikeash.com/pyblog/introducing-mazeroingweakref.html</link><description>I'm extremely excited to announce a new library for Cocoa and Cocoa Touch development: &lt;code&gt;MAZeroingWeakRef&lt;/code&gt;. In short, it's a library which allows zeroing weak references to be used in retain/release Cocoa code. This has all sorts of uses and should make retain/release coding less painful. While I discussed this in detail in &lt;a href="friday-qa-2010-07-16-zeroing-weak-references-in-objective-c.html"&gt;my Friday Q&amp;amp;A post this week&lt;/a&gt;, I also want to make a separate announcement for people who don't want to read through all of the horrible details.&lt;br&gt;&lt;a href="http://www.mikeash.com/pyblog/introducing-mazeroingweakref.html"&gt;(Read More)&lt;/a&gt;</description><guid isPermaLink="true">http://www.mikeash.com/?page=pyblog/introducing-mazeroingweakref.html</guid><pubDate>Fri, 16 Jul 2010 20:19:00 GMT</pubDate></item><item><title>Friday Q&amp;amp;A 2010-07-16: Zeroing Weak References in Objective-C
</title><link>http://www.mikeash.com/pyblog/friday-qa-2010-07-16-zeroing-weak-references-in-objective-c.html</link><description>It's that time of the biweek again. For this week's Friday Q&amp;amp;A, Mike Shields has suggested that I talk about weak references in Objective-C, and specifically zeroing weak references. I've gone a bit further and actually implemented a class that provides zeroing weak references in Objective-C using manual memory management.&lt;br&gt;&lt;a href="http://www.mikeash.com/pyblog/friday-qa-2010-07-16-zeroing-weak-references-in-objective-c.html"&gt;(Read More)&lt;/a&gt;</description><guid isPermaLink="true">http://www.mikeash.com/?page=pyblog/friday-qa-2010-07-16-zeroing-weak-references-in-objective-c.html</guid><pubDate>Fri, 16 Jul 2010 20:18:00 GMT</pubDate></item><item><title>Friday Q&amp;amp;A 2010-07-02: Background Timers
</title><link>http://www.mikeash.com/pyblog/friday-qa-2010-07-02-background-timers.html</link><description>Welcome back to another Friday Q&amp;amp;A. This week I'm departing from my usual user-driven format to present a class I've written for what I'm calling "background timers", and discuss potential uses for it.&lt;br&gt;&lt;a href="http://www.mikeash.com/pyblog/friday-qa-2010-07-02-background-timers.html"&gt;(Read More)&lt;/a&gt;</description><guid isPermaLink="true">http://www.mikeash.com/?page=pyblog/friday-qa-2010-07-02-background-timers.html</guid><pubDate>Fri, 02 Jul 2010 16:45:00 GMT</pubDate></item><item><title>Blocks and GCD in Russian
</title><link>http://www.mikeash.com/pyblog/blocks-and-gcd-in-russian.html</link><description>Alexander Babaev has been kind enough to translate my series of posts on blocks and GCD into Russian for &lt;a href="http://touchdev.ru/"&gt;TouchDev.ru&lt;/a&gt;. So far he has posted two, &lt;a href="http://touchdev.ru/documents/1533"&gt;Blocks in Objective-C&lt;/a&gt; and &lt;a href="http://touchdev.ru/documents/1519"&gt;Intro to Grand Central Dispatch, Part I&lt;/a&gt;. Others in the series will be going up in the future. If you happen to speak Russian, check them out!&lt;br&gt;&lt;a href="http://www.mikeash.com/pyblog/blocks-and-gcd-in-russian.html"&gt;(Read More)&lt;/a&gt;</description><guid isPermaLink="true">http://www.mikeash.com/?page=pyblog/blocks-and-gcd-in-russian.html</guid><pubDate>Tue, 29 Jun 2010 15:22:00 GMT</pubDate></item><item><title>Friday Q&amp;amp;A 2010-06-18: Implementing Equality and Hashing
</title><link>http://www.mikeash.com/pyblog/friday-qa-2010-06-18-implementing-equality-and-hashing.html</link><description>Welcome back to a late edition of Friday Q&amp;amp;A. WWDC pushed the schedule back one week, but it's finally time for another one. This week, I'm going to discuss the implementation of equality and hashing in Cocoa, a topic suggested by Steven Degutis.&lt;br&gt;&lt;a href="http://www.mikeash.com/pyblog/friday-qa-2010-06-18-implementing-equality-and-hashing.html"&gt;(Read More)&lt;/a&gt;</description><guid isPermaLink="true">http://www.mikeash.com/?page=pyblog/friday-qa-2010-06-18-implementing-equality-and-hashing.html</guid><pubDate>Fri, 18 Jun 2010 14:48:00 GMT</pubDate></item><item><title>Friday Q&amp;amp;A 2010-05-28: Leopard Collection Classes
</title><link>http://www.mikeash.com/pyblog/friday-qa-2010-05-28-leopard-collection-classes.html</link><description>Welcome back to another edition of Friday Q&amp;amp;A. For this week's post, I'm going to talk about three somewhat obscure collections classes that were introduced to Cocoa in 10.5: &lt;code&gt;NSPointerArray&lt;/code&gt;, &lt;code&gt;NSHashTable&lt;/code&gt;, and &lt;code&gt;NSMapTable&lt;/code&gt;, a topic suggested by Phil Holland.&lt;br&gt;&lt;a href="http://www.mikeash.com/pyblog/friday-qa-2010-05-28-leopard-collection-classes.html"&gt;(Read More)&lt;/a&gt;</description><guid isPermaLink="true">http://www.mikeash.com/?page=pyblog/friday-qa-2010-05-28-leopard-collection-classes.html</guid><pubDate>Fri, 28 May 2010 16:43:00 GMT</pubDate></item><item><title>Some Light Reading
</title><link>http://www.mikeash.com/pyblog/some-light-reading.html</link><description>As I mentioned last week, I'm shifting Friday Q&amp;amp;A to a biweekly schedule, so there will be no Friday Q&amp;amp;A this week. However, I've dug up a few articles that I enjoyed reading this week and that I thought you might enjoy as well.&lt;br&gt;&lt;a href="http://www.mikeash.com/pyblog/some-light-reading.html"&gt;(Read More)&lt;/a&gt;</description><guid isPermaLink="true">http://www.mikeash.com/?page=pyblog/some-light-reading.html</guid><pubDate>Fri, 21 May 2010 16:02:00 GMT</pubDate></item><item><title>SocketObjC: A Networkable Messaging Library
</title><link>http://www.mikeash.com/pyblog/socketobjc-a-networkable-messaging-library.html</link><description>Reader Steven Degutis was inspired by &lt;a href="friday-qa-2009-02-20-the-good-and-bad-of-distributed-objects.html"&gt;my post about Distributed Objects&lt;/a&gt; and decided to make something that avoided those pitfalls. The result is &lt;a href="http://github.com/sdegutis/SocketObjC"&gt;SocketObjC&lt;/a&gt;, a remote messaging library that uses &lt;a href="friday-qa-2010-02-05-error-returns-with-continuation-passing-style.html"&gt;continuation passing style&lt;/a&gt; to achieve full asynchronous messaging. I haven't tried it, but it's &lt;a href="http://github.com/sdegutis/SocketObjC"&gt;worth checking out&lt;/a&gt;.&lt;br&gt;&lt;a href="http://www.mikeash.com/pyblog/socketobjc-a-networkable-messaging-library.html"&gt;(Read More)&lt;/a&gt;</description><guid isPermaLink="true">http://www.mikeash.com/?page=pyblog/socketobjc-a-networkable-messaging-library.html</guid><pubDate>Mon, 17 May 2010 21:27:00 GMT</pubDate></item><item><title>Friday Q&amp;amp;A 2010-05-14: What Every Apple Programmer Should Know
</title><link>http://www.mikeash.com/pyblog/friday-qa-2010-05-14-what-every-apple-programmer-should-know.html</link><description>Welcome back to another Friday Q&amp;amp;A. This week, Quentin Carnicelli (who is heavily involved in generating my paychecks) has suggested that I talk about things that every Apple programmer should know. In other words, common Cocoa design and implementation decisions that I'd prefer Apple not to make.&lt;br&gt;&lt;a href="http://www.mikeash.com/pyblog/friday-qa-2010-05-14-what-every-apple-programmer-should-know.html"&gt;(Read More)&lt;/a&gt;</description><guid isPermaLink="true">http://www.mikeash.com/?page=pyblog/friday-qa-2010-05-14-what-every-apple-programmer-should-know.html</guid><pubDate>Fri, 14 May 2010 15:36:00 GMT</pubDate></item><item><title>iPhone Apps I Can't Have
</title><link>http://www.mikeash.com/pyblog/iphone-apps-i-cant-have.html</link><description>During a recent discussion on Twitter about Apple's draconion App Store policies, I mentioned that there's a long list of apps I want which Apple does not allow, and thus these restrictions directly hurt me not only as a developer, but as an iPhone user. This made &lt;a href="https://twitter.com/pbur"&gt;@pbur&lt;/a&gt; curious, and he indicated he'd like to know what those apps are. So I sat down and came up with a list of apps that I really want for my iPhone but that Apple won't let me have. To the best of my knowledge, every single one of these ideas is completely feasible in a technical sense, wouldn't destroy the cell network, wouldn't make your phone's battery life unusably short, and are kept out of my hands solely because Apple thinks it knows what's best for me.&lt;br&gt;&lt;a href="http://www.mikeash.com/pyblog/iphone-apps-i-cant-have.html"&gt;(Read More)&lt;/a&gt;</description><guid isPermaLink="true">http://www.mikeash.com/?page=pyblog/iphone-apps-i-cant-have.html</guid><pubDate>Fri, 14 May 2010 02:46:00 GMT</pubDate></item><item><title>Another Week Without Friday Q&amp;amp;A
</title><link>http://www.mikeash.com/pyblog/another-week-without-friday-qa.html</link><description>I must apologize, but I ran out of time this week and don't have a Friday Q&amp;amp;A for you to enjoy. If you want something to read, you might enjoy &lt;a href="http://www.friday.com/bbum/2009/09/06/iniailize-can-be-executed-multiple-times-load-not-so-much/"&gt;+initialize Can Be Executed Multiple Times (+load not so much)&lt;/a&gt; from Bill Bumgarner, &lt;a href="http://kickingbear.com/blog/archives/9"&gt;Collection Extensions&lt;/a&gt; from friend-of-the-blog Guy English, and &lt;a href="http://chanson.livejournal.com/179229.html"&gt;launchd: Better than sliced bread!&lt;/a&gt; from Chris Hanson.&lt;br&gt;&lt;a href="http://www.mikeash.com/pyblog/another-week-without-friday-qa.html"&gt;(Read More)&lt;/a&gt;</description><guid isPermaLink="true">http://www.mikeash.com/?page=pyblog/another-week-without-friday-qa.html</guid><pubDate>Fri, 07 May 2010 23:08:00 GMT</pubDate></item><item><title>Friday Q&amp;amp;A 2010-04-30: Dealing with Retain Cycles
</title><link>http://www.mikeash.com/pyblog/friday-qa-2010-04-30-dealing-with-retain-cycles.html</link><description>Happy iPad 3G day to everyone. Whether you're waiting in line, waiting for the delivery guy, or just pining at home like I am, you can fill your idle moments with another edition of Friday Q&amp;amp;A. This week, Filip van der Meeren has suggested that I discuss retain cycles and how to deal with them.&lt;br&gt;&lt;a href="http://www.mikeash.com/pyblog/friday-qa-2010-04-30-dealing-with-retain-cycles.html"&gt;(Read More)&lt;/a&gt;</description><guid isPermaLink="true">http://www.mikeash.com/?page=pyblog/friday-qa-2010-04-30-dealing-with-retain-cycles.html</guid><pubDate>Fri, 30 Apr 2010 15:29:00 GMT</pubDate></item><item><title>Friday Q&amp;amp;A 2010-04-23: Implementing a Custom Slider
</title><link>http://www.mikeash.com/pyblog/friday-qa-2010-04-23-implementing-a-custom-slider.html</link><description>Welcome to another chilling edition of Friday Q&amp;amp;A. While I hope to be soaring over the scenic Shenandoah Valley on this fine Friday, I have taken the precaution of preparing my post in advance, so that you may see it even while I am incommunicado. Such is the magic of the modern world. This week, Michael Crawford has suggested that I give in example of implementing a custom control in Cocoa.&lt;br&gt;&lt;a href="http://www.mikeash.com/pyblog/friday-qa-2010-04-23-implementing-a-custom-slider.html"&gt;(Read More)&lt;/a&gt;</description><guid isPermaLink="true">http://www.mikeash.com/?page=pyblog/friday-qa-2010-04-23-implementing-a-custom-slider.html</guid><pubDate>Fri, 23 Apr 2010 16:01:00 GMT</pubDate></item><item><title>Mistakes and Chains of Events
</title><link>http://www.mikeash.com/pyblog/mistakes-and-chains-of-events.html</link><description>For those of you who don't read &lt;a href="http://www.rogueamoeba.com/utm/"&gt;my employer's blog&lt;/a&gt;, I just made a post over there titled &lt;a href="http://www.rogueamoeba.com/utm/2010/04/19/mistakes-and-chains-of-events/"&gt;Mistakes and Chains of Events&lt;/a&gt;. It discusses the recent news about political cartoonist Mark Fiore's iPhone rejection, the bigger picture of Apple's system and policies, and my perception that Apple is not learning the right lessons from the various problems that they're encountering.&lt;br&gt;&lt;a href="http://www.mikeash.com/pyblog/mistakes-and-chains-of-events.html"&gt;(Read More)&lt;/a&gt;</description><guid isPermaLink="true">http://www.mikeash.com/?page=pyblog/mistakes-and-chains-of-events.html</guid><pubDate>Mon, 19 Apr 2010 19:18:00 GMT</pubDate></item><item><title>Friday Q&amp;amp;A 2010-04-16: Implementing Fast Enumeration
</title><link>http://www.mikeash.com/pyblog/friday-qa-2010-04-16-implementing-fast-enumeration.html</link><description>Last week I discussed &lt;a href="http://www.mikeash.com/pyblog/friday-qa-2010-04-09-comparison-of-objective-c-enumeration-techniques.html"&gt;the various options available in Objective-C for enumerating over a collection&lt;/a&gt; This week I'm going to finish up the discussion of enumeration with a guide on how to implement Fast Enumeration in your own program.&lt;br&gt;&lt;a href="http://www.mikeash.com/pyblog/friday-qa-2010-04-16-implementing-fast-enumeration.html"&gt;(Read More)&lt;/a&gt;</description><guid isPermaLink="true">http://www.mikeash.com/?page=pyblog/friday-qa-2010-04-16-implementing-fast-enumeration.html</guid><pubDate>Fri, 16 Apr 2010 16:35:00 GMT</pubDate></item><item><title>An Objective-C Continuations Library
</title><link>http://www.mikeash.com/pyblog/an-objective-c-continuations-library.html</link><description>A couple of months ago I wrote about &lt;a href="http://mikeash.com/pyblog/friday-qa-2010-02-05-error-returns-with-continuation-passing-style.html"&gt;using Continuation Passing Style&lt;/a&gt; in Objective-C as an alternative technique for returning errors from methods. The major downside to that technique is that it integrates poorly with Cocoa, since Cocoa isn't written to use CPS. Jordan Breeding has spent the intervening time building up &lt;a href="http://www.jordanbreeding.com/blog/2010/4/8/introducing-continuations-for-objective-c.html"&gt;an impressive CPS adapter library&lt;/a&gt; which allows converting any Cocoa &lt;code&gt;NSError **&lt;/code&gt; call into CPS style with virtually no work. Source code and extensive examples are available, and I encourage you to &lt;a href="http://www.jordanbreeding.com/blog/2010/4/8/introducing-continuations-for-objective-c.html"&gt;check it out&lt;/a&gt;.&lt;br&gt;&lt;a href="http://www.mikeash.com/pyblog/an-objective-c-continuations-library.html"&gt;(Read More)&lt;/a&gt;</description><guid isPermaLink="true">http://www.mikeash.com/?page=pyblog/an-objective-c-continuations-library.html</guid><pubDate>Tue, 13 Apr 2010 16:25:00 GMT</pubDate></item><item><title>Friday Q&amp;amp;A 2010-04-09: Comparison of Objective-C Enumeration Techniques
</title><link>http://www.mikeash.com/pyblog/friday-qa-2010-04-09-comparison-of-objective-c-enumeration-techniques.html</link><description>Welcome back to another edition of Friday Q&amp;amp;A. Preston Sumner has suggested that I talk about different ways of enumerating over collections in Cocoa, and how to implement Fast Enumeration. This will be a two part series: this week I will look at the different enumeration techniques and their pros and cons, and then next week I will take you through implementing Fast Enumeration on a custom object.&lt;br&gt;&lt;a href="http://www.mikeash.com/pyblog/friday-qa-2010-04-09-comparison-of-objective-c-enumeration-techniques.html"&gt;(Read More)&lt;/a&gt;</description><guid isPermaLink="true">http://www.mikeash.com/?page=pyblog/friday-qa-2010-04-09-comparison-of-objective-c-enumeration-techniques.html</guid><pubDate>Fri, 09 Apr 2010 11:17:00 GMT</pubDate></item></channel></rss>
