I have developed a application where i am fetching data from core data and i am displaying it in a table view. I got everything fine until fetching the data but while inserting them to table view only the last entry is displaying in the table view. Below is the code i have written please preview and help me to get the solution.
Deviceinfo *app = [arr objectAtIndex:indexPath.row];
switch(indexPath.row)
{
case 0:
NSLog(@"%@",app.platform);
cell.textLabel.text = @"platform";
cell.detailTextLabel.text =[app platform];
case 1:
NSLog(@"%@",app.model);
cell.textLabel.text = @"model";
cell.detailTextLabel.text = [app model];
case 2:
NSLog(@"%@",app.mac_address);
cell.textLabel.text = @"mac address";
cell.detailTextLabel.text = [app mac_address];
}
return cell;
I implement this code in the cellForRowAtIndexpath delegate. I am getting only the mac address in table view. hoping for better solution
Thanks
Insert break statements after each case, otherwise the case will just fall though to the next one
Based on your additional comments, try something like the following: Each device will have its own table view section and each section will have 3 table view rows, one for each piece of information.