I am just trying to clarify that this is the easiest and most efficient way to make the array of titles for the cells in my tableview.
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
contentArray = [[NSArray arrayWithObjects:@"Hi1", @"Hi2", @"Hi3", @"Hi4", @"Hi5", @"Hi6", @"Hi7", nil] retain];
return [contentArray count];
[contentArray release];
}
Should I be doing this another way or this efficient and the best it can be? Because currently it is a bit laggy and I would like to make it a bit faster.
Thanks!
Calls to the method
tableView:numberOfRowsInSection:can be triggered by different events. You are creating the array on each call, which increases the lag. Try this instead: