Quantcast
Channel: Vincent Gable's Blog » MacOSX
Browsing latest articles
Browse All 10 View Live

N.A.R.C.

How to remember Cocoa memory management: Think NARC: “New Alloc Retain Copy”. If you are not doing any of those things, you don’t need to release. –Andiih on Stack Overflow Personally, I like to...

View Article



drain an NSAutoReleasePool Don’t release it

To clean up an NSAutoreleasePool, do [pool drain]; not [pool release]; In a garbage-collected environment, sending any object a release message is hardcoded by the runtime to do nothing (very quickly)....

View Article

NSHomeDirectory() is a Bad Thing

Code that uses NSHomeDirectory() is probably doing The Wrong Thing. It’s not appropriate to clutter up the user’s home directory — internal application-data should be stored in the Application Support...

View Article

Quality is Money

The truth is that an iPad app is neither easier nor harder to make than an iPhone app (or a Mac or Windows app), in any general, reasonable, defensible way. Software doesn’t work like that; we don’t...

View Article

Simulator Advertising?

I wish I could take credit for this idea, but it’s from someone else, will Apple sell iAds that only show up in the iPhone simulator? Probably not, but it would be a hell of a targeted demographic. For...

View Article


Ask F-Script!

F-Script is an amazingly useful tool for answering quick API questions, like “What happens if I pass in nil“. I use it several times a week. For verifying corner-cases, F-Script is faster than google,...

View Article

NSDictionary Copies It’s Keys

An NSDictionary will retain it’s objects, and copy it’s keys. Here are some effects this has had on code I’ve worked on. Sometimes you get the same object you put in, sometimes not. Immutable objects...

View Article

“Ok”

It’s a small thing, but it breeds deep suspicion. Mac OS dialogs always had “OK” buttons (capital O, capital K). Windows dialogs had “Ok” buttons (Capital O, lowercase k). “Ok” buttons in Mac/iOS...

View Article


#define String

When I need a string-constant, I #define it, instead of doing the “right” thing and using an extern const NSString * variable. UPDATE 2010-07-20 Thanks to Elfred Pagen for pointing out that you should...

View Article


The Most Useful Objective-C Code I’ve Ever Written

Actually, it’s the most useful code I’ve extended; credit for the core idea goes to Dave Dribin with his Handy NSString Conversion Macro. LOG_EXPR(x) is a macro that prints out x, no matter what type x...

View Article
Browsing latest articles
Browse All 10 View Live




Latest Images