Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (NSString *) reuseIdentifier {
- return @"myIdentifier";
- }
- - (UITableViewCell *)tableView:(UITableView *)tableView
- cellForRowAtIndexPath:(NSIndexPath *)indexPath {
- static NSString *CellIdentifier = @"CustomTableCell";
- static NSString *CellNib = @"CustomTableCellView";
- UITableViewCell *cell = (UITableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
- if (cell == nil) {
- NSArray *nib = [[NSBundle mainBundle] loadNibNamed:CellNib owner:self options:nil];
- cell = (UITableViewCell *)[nib objectAtIndex:0];
- }
- // perform additional custom work...
- return cell;
- }
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
- UITableViewCell *cell = (UITableViewCell *)[tableView dequeueReusableCellWithIdentifier:@"CustomCellId"];
- if (cell == nil) {
- UIViewController *c = [[UIViewController alloc]
- initWithNibName:@"CustomCell" bundle:nil];
- cell = (PostCell *)c.view;
- [c release];
- }
- return cell;
- }
- static NSData *sLoadedCustomCell = nil;
- cell = [tableView dequeueReusableCellWithIdentifier:@"CustomCell"];
- if (cell == nil)
- {
- if (sLoadedCustomCell == nil)
- {
- // Load the custom table cell xib
- // and extract a reference to the cell object returned
- // and cache it in a static to avoid reloading the nib again.
- for (id loadedObject in [[NSBundle mainBundle] loadNibNamed:@"CustomCell" owner:nil options:nil])
- {
- if ([loadedObject isKindOfClass:[UITableViewCell class]])
- {
- sLoadedCustomCell = [[NSKeyedArchiver archivedDataWithRootObject: loadedObject] retain];
- break;
- }
- }
- cell = (UITableViewCell *)[NSKeyedUnarchiver unarchiveObjectWithData: sLoadedCustomCell];
- }
- ChainesController *c = [[ChainesController alloc] initWithNibName:@"ChainesController" bundle:nil];
- [[NSBundle mainBundle] loadNibNamed:@"ChaineArticleCell" owner:c options:nil];
- cell = [c.blogTableViewCell retain];
- [c release];
Add Comment
Please, Sign In to add comment