How would I get the text of the last 10 tweets, for a specific twitter use开发者_运维技巧r, into an NSArray?
In more modern versions of iOS, you can access Twitter directly via the Social Framework. Twitter has some example code available which shows how to use it.
You could, if you need something for earlier versions of iOS, check out MGTwitterEngine. It'll take care of all the heavy lifting required. Specifically, the methods getUserTimelineFor sinceID startingAtPage count
and getUserTimelineFor sinceID withMaximumID startingAtPage count
will fetch what you're looking for. It is getting a little long in the tooth, however, so making use of the built-in iOS stuff is preferable.
You would have to parse the json with something similar to what is described here: http://blog.zachwaugh.com/post/309924609/how-to-use-json-in-cocoaobjective-c and here: http://mobile.tutsplus.com/tutorials/iphone/iphone-json-twitter-api/
精彩评论