how do i make a table view cell for 2.2.1?

Discussion in 'iOS Programming' started by Chirone, Oct 6, 2009.

  1. Chirone macrumors 6502

    Joined:
    Mar 2, 2009
    Location:
    NZ
    #1
    sorry, this is probably a really easy question

    but in iphone 3.0 you could use this

    Code:
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
    inside the
    Code:
    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    method

    but when switching to 2.2.1 the method is not found and the UITableViewCellStyleDefault is not declared
    and a nil cell gets sent back causing a crash
    what's the equivalent way to create the cell in 2.2.1?
     
  2. Chirone thread starter macrumors 6502

    Joined:
    Mar 2, 2009
    Location:
    NZ
    #2
    nevermind

    Code:
    cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
     

Share This Page