Reputation:
I was wondering, how, using objective-c + IB, would I output each object in an array into it's own row in a view. Take for example, Tweetie, say I had an array full of tweets (NSStrings), I would like to output each tweet (or nsstring) in it's own bubble as is implemented in tweetie.
I know it's slightly confusing but any help would be appreciated!
Thanks in advance! - I'm doing mac dev by the way.
Upvotes: 0
Views: 263
Reputation: 237010
To get a view like Tweetie for Mac's, an NSTableView of custom NSCells in an NSScrollView would probably be the simplest way. Basically, the first NSTableColumn would be bound to the users' avatars and the second would be a custom "bubble" NSCell that displays the username, time and text of the tweet. Each row would need to have its height determined dynamically, but fortunately, NSTableView can do that these days.
Note that this is far from the only way to do it, and it's probably not even the best. It's just the simplest that immediately occurs to me. Hopefully the description helps give you a push in the right direction.
Upvotes: 0
Reputation: 3192
Take a look on NSTableView (on Mac) and UITableView (on iPhone) basic examples.
Upvotes: 4