I’m new in iOS development, and i’m looking for some help on my UITableView issue.
Well, i was studying everything about the UITableView code, and, during the development, when i’m trying to reuse the identifier (in case that there’s no cell to create on the interface), the XCode shows the message:
“No visible @interface for ‘UITableView’ declares the selector ‘initWithStyle:reuseIdentifier:”
There’s the code:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
static NSString *identifier = @"Cell";
UITableView *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
if(cell ==nil)
{
cell = [[[UITableView alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier] autorelease];
}
Could someone help me here?
should be
you should allocate a
UITableViewCellnotUITableViewlike what you’ve done here.and dont forget to return it later.