Skip to content

Instantly share code, notes, and snippets.

@IvanovDeveloper
Last active July 26, 2016 08:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IvanovDeveloper/e31035011b096caf555125ff2e6fbeac to your computer and use it in GitHub Desktop.
Save IvanovDeveloper/e31035011b096caf555125ff2e6fbeac to your computer and use it in GitHub Desktop.
//Create cell from storyboard
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"PlayerCell"];
//Create cell programmatically
static NSString *cellIdentifier = @"cellIdentifier";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if (cell == nil)
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
//Create cell from xib
static NSString *cellIdentifier = kTicketCellReuseID;
TicketCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if(!cell) {
UINib *nib = [UINib nibWithNibName:NSStringFromClass([TicketCell class]) bundle:nil];
[tableView registerNib:nib forCellReuseIdentifier:cellIdentifier];
cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment