Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jan 19, 2009, 02:59 PM   #1
dtrimble
macrumors member
 
Join Date: Jan 2008
Location: San Francisco, CA, USA
Send a message via Skype™ to dtrimble
curl, grep, and cut on the iPhone

Good morning,

Background: I'm brand new to developing applications on the iPhone, and even to the Mac, more or less. In the 1990s, I did a lot of development on PCs in VB, QB, PDS, and some moderate work in Assembly, and Perl. I know scripting on the Mac reasonably well, and most Web languages, but am new to Objective C and Apple's frameworks and SDKs. I haven't done professional-grade programming since the mid-1990s.

I'm trying to create a relatively simple iPhone app based on a script I wrote for Mac OS X. It simply fetches a URL, uses grep to find a specific file name referenced in the code and that changes regularly, and then retrieves that specific file name. In this case, it is an image file that updates on a regular basis.

Right now, I don't want to focus on making my iPhone app all shiny and iPhone-ish. I can learn how to add in the functionality for creating a cover flow view, swiping, navigation, and useful functionality after I get past rewriting the basic script commands into a working set of C code.

So my question comes down to this: is there an Objective C equivalent to the script commands for curl, grep, and cut that will work with iPhone SDK? I haven't had any luck finding them in Apple's reference documents.


Dan
dtrimble is offline   0 Reply With Quote
Old Jan 19, 2009, 10:05 PM   #2
xsmasher
macrumors regular
 
Join Date: Jul 2008
Quote:
Originally Posted by dtrimble View Post
So my question comes down to this: is there an Objective C equivalent to the script commands for curl, grep, and cut that will work with iPhone SDK? I haven't had any luck finding them in Apple's reference documents.
Yes. You can grab the contents of a URL with NSString stringWithContentsOfURL: . Then you can find the image you're looking for with the Standard C Library regex functions in regex.h . Then you can display the image using a UIWebView or a UIImage.
xsmasher is offline   0 Reply With Quote
Old Jan 20, 2009, 01:26 AM   #3
chbeer
macrumors member
 
Join Date: Sep 2008
Location: Berlin
You can also scan the string using NSScanner. That's a quite easy class for scanning strings for other strings and such.
__________________
Learn vocabulary on-the-go? iVocabulary!

Follow iVocabulary on Twitter!
chbeer is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
Final Cut Studio on the go drexl5 MacBook Pro 0 Jan 2, 2011 10:12 PM
Why do some App icons appear as "Retina icons" in the Store and not on the iPhone? anti-microsoft iPhone 8 Nov 21, 2010 01:32 AM
Simultaneous talking and surfing on the iPhone 3G? rickdorr iPhone 10 Jun 11, 2008 10:09 PM
Google Moon, Mars, and Sky on the iPhone - iPod touch infosprt iPhone 4 Dec 14, 2007 10:04 PM


All times are GMT -5. The time now is 05:43 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC