Am try to populate my table from core data and it give an error at this line
Tips *tipy = [arr objectAtIndex:indexPath.row];
here is my .m file
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return [arr count];
}
- (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];
}
Tips *tipy = [arr objectAtIndex:indexPath.row];
cell.textLabel.text = [tipy tipdescription];
cell.detailTextLabel.text = [tipy.tipnumber stringValue];
return cell;
}
app and arr is declared in the .h file as and also synthesized in the .m file
@property (nonatomic, retain) AppDelegate *app;
@property(nonatomic, assign) NSArray *arr;