Im wondering what is the simplest way to get the current price of a stock from say yahoo finance (or similar) in objective-C For the iPhone SDK.
Simple is the key, I am looking for current price, and days movement.
I havent had much luck finding an iPhone code example or library.
regards
Use an NSURLRequest
object to retrieve the data at this address:
http://download.finance.yahoo.com/d/quotes.csv?s=AAPL&f=sl1d1t1c1ohgv&e=.csv
Using [NSString stringWithFormat:]
to change the AAPL to the stock ticker you want to use. The retrieved data is in CSV format so you will need to parse that to get the individual values you require. This can be done in this simple case using [NSString componentsSeparatedByString: @","]
to retieve an array which you can parse using two loops.