View Full Version : Placing texts on Table instead of label

Jul 15, 2008, 08:54 PM

Instead of using labels to place the typed text in iPhone, i would like to use a TableView (UITableview). A snippet of a code to display texts on label is as follows:

self.string = textField.text;
. . .
. . .

NSString *greeting = [[NSString alloc] initWithFormat:@"%@!",
label.text = greeting;
[greeting release];

Is there a similar method or code that i could follow for texts in TableView?


Jul 16, 2008, 08:15 AM
UITableViews require delegate methods to display data. There are many delegate methods, but the two that you must implement are the one that tells the table how many rows it has, and the other one is the one that tells the individual cells what to display. It sounds complicated, but it actually makes a lot of sense once you get accustomed to working with objective-c. There are some video tutorials over at iphonedevcentral.org that explain how to work with UITableViews.

Jul 20, 2008, 05:51 AM
I see. Alright. Its gonna take me some time to understand it but i know i will get the gist of it soon. Thanks for the help.


Jul 22, 2008, 08:28 PM
To learn more about how to use table views and table views with a navigation controller, visit this tutorial


iPhone SDK Articles