Placing texts on Table instead of label

Discussion in 'iOS Programming' started by gryym, Jul 15, 2008.

  1. macrumors newbie

    Joined:
    Jul 14, 2008
    #1
    Hi,

    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:mad:"%@!",
    nameString];
    label.text = greeting;
    [greeting release];


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

    Thx!
     
  2. macrumors regular

    Joined:
    Jan 18, 2006
    #2
    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.
     
  3. thread starter macrumors newbie

    Joined:
    Jul 14, 2008
    #3
    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.

    =)
     
  4. macrumors newbie

    Joined:
    Jul 22, 2008
    #4

Share This Page