Since XCode 4, there is now a Code Snippets section which offers the snippets via auto-complete when typing. I\'d be very interested in snippets you all have stored in there. Wh
I don't if this counts but I always use this snippet whenever I add a UITableView
in any of my view controllers.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *cellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if(cell == nil)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle
reuseIdentifier:cellIdentifier];
// Do something here......................
}
// Do something here too .........................
return cell;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return ;
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return ;
}
its quite handy if you are not using a UITableViewController
to show table contents.