PDA

View Full Version : how do i make a table view cell for 2.2.1?




Chirone
Oct 6, 2009, 04:59 PM
sorry, this is probably a really easy question

but in iphone 3.0 you could use this

cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
inside the
- (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?



Chirone
Oct 6, 2009, 05:57 PM
nevermind

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