Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///////////////////////////////////////////////////////////////
- mydataclass.m
- //////////////////////////////////////////////////////////////
- -(NSArray *)searchAllData {
- NSFetchRequest *request = [[NSFetchRequest alloc]init];
- [request setEntity:entitydescription];
- NSError * error=nil;
- NSArray *matchData = [context executeFetchRequest:request error:&error];
- return matchData;
- }
- /////////////////////////////////////////////////////////////
- viewcontroller.m
- ////////////////////////////////////////////////////////////
- for (TaskyEntity *task in [mycoredata searchAllData]) {
- NSLog(@"title: %@",task.title);
- NSLog(@"i:%i ",i);
- i++;
- }
- //////////////////////////////////////////////////////////
- output
- /////////////////////////////////////////////////////////
- 2013-03-17 19:31:08.462 tasky[2623:c07] title: (null)
- 2013-03-17 19:31:08.463 tasky[2623:c07] i:1
- 2013-03-17 19:31:08.464 tasky[2623:c07] title: (null)
- 2013-03-17 19:31:08.464 tasky[2623:c07] i:2
- 2013-03-17 19:31:08.465 tasky[2623:c07] title: (null)
- 2013-03-17 19:31:08.466 tasky[2623:c07] i:3
Advertisement
Add Comment
Please, Sign In to add comment