1

I have a core data database and I would like to show the data into a tableview. I have been searching on the web how to do that but I never can find it.

NSEntityDescription *entitydesc = [NSEntityDescription entityForName:@"Host" inManagedObjectContext;context];
NSFetchRequest *request = [[NSFetchRequest alloc]init];
[request setEntity:entitydesc];

NSPredicate *predicate = [NSPredicate predicateWithFormat:@"I DON'T KNOW WHAT TO PUT HERE"];
[request setPredicate:predicate];

But I have no idea what I have to write in the predicateWithFormat so I can select all the data of my database table.

And when I have all the data of my database table how can I put them in an array so i can add the array to a tableview?

Thanks :)

Andrew Madsen
  • 21,309
  • 5
  • 56
  • 97

1 Answers1

1

from the NSFetchRequest docs:

If you don’t specify a predicate, then all instances of the specified entity are selected

wattson12
  • 11,176
  • 2
  • 32
  • 34