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!

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Theme: Shocking Blue Green. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.