Go Back   MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jan 19, 2009, 03: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, 11: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, 02: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

Similar Threads
thread Thread Starter Forum Replies Last Post
Help with TextWrangler GREP? JacobJones Mac Applications and Mac App Store 1 Jun 13, 2013 07:40 AM
grep syntax help Big Dave Mac Programming 4 Jan 24, 2013 09:54 AM
Fade no Curl. IDMah iPhone/iPad Programming 5 Sep 7, 2012 03:19 PM
Install curl on ML dutchnewbie OS X 10.8 Mountain Lion 4 Aug 9, 2012 08:17 PM
popen call to grep farmerdoug Mac Programming 7 Jun 12, 2012 02:37 PM

Forum Jump

All times are GMT -5. The time now is 11:31 AM.

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

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