Ternary Operator

April 4, 2008

Processing Command Arguments in Foundation, The Easy Way

Filed under: Uncategorized — Tags: , — James @ 10:19 pm

I needed to write a small commandline utility. I could’ve done it in C, but I like Cocoa so I’m doing it in ObjC. It’s great.

Anyway, I needed to parse the arguments to my utility and so I started trying to remember the best way to pull what I needed out of char**argv; I seemed to recall a built-in function on Unix so I started Googling…

…and I found this great post by Greg Miller describing how to do it with NSUserDefaults.

This almost makes up for the travesty that is web services on the platform.

Thanks, Apple!


No Comments Yet »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.