Create cell in tableview

        static NSString *CellIdentifier = @”FolderListItemCell”;

        cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

        id object;

        

        object = [[self.rows objectAtIndex:indexPath.section]objectAtIndex:indexPath.row];

        

        Class cellClass = [self cellClassForObject:object];

        const char* className = class_getName(cellClass);

        NSString* identifier = [[NSString alloc] initWithBytesNoCopy:(char*)className

                                                              length:strlen(className)

                                                            encoding:NSASCIIStringEncoding

                                                        freeWhenDone:NO];

        if (nil == cell) {

            cell = [[cellClass alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier];

        }

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s