News for hackers. Stuff that matters.
Re:NSNotificationCenter with blocks considered harmful by matwood on Wednesday November 20, 2013 @09:02AM (#6767981)
Apple's sample code is terrible. I've always assumed it is written by interns because it is generally bug ridden and often not the right way to do something.
Re:NSNotificationCenter with blocks considered harmful by chc on Wednesday November 20, 2013 @01:50PM (#6770127)
Do you mean the code examples in articles or the projects that you can download? Because I haven't looked at their downloadable samples in quite some time, but their docs always seem alright to me.
Re:NSNotificationCenter with blocks considered harmful by seandougall on Wednesday November 20, 2013 @05:18PM (#6771609)
Both, in my experience. The downloadable code is usually a rush job and has all sorts of sloppiness and missed edge cases. The code in the docs is usually cleaner (because it's just excerpts), but doesn't always get updated when APIs change.
Re:NSNotificationCenter with blocks considered harmful by matwood on Thursday November 21, 2013 @12:11AM (#6773165)
The code samples are just bad and many are very outdated. I generally just read the header comments now and hit SO if I need more.