MaysamSh

Untitled

Mar 17th, 2013
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ///////////////////////////////////////////////////////////////
  2. mydataclass.m
  3. //////////////////////////////////////////////////////////////
  4. -(NSArray *)searchAllData {
  5.     NSFetchRequest *request = [[NSFetchRequest alloc]init];
  6.     [request setEntity:entitydescription];
  7.     NSError * error=nil;
  8.     NSArray *matchData = [context executeFetchRequest:request error:&error];
  9.    
  10.     return matchData;
  11. }
  12. /////////////////////////////////////////////////////////////
  13. viewcontroller.m
  14. ////////////////////////////////////////////////////////////
  15.     for (TaskyEntity *task in [mycoredata searchAllData]) {
  16.         NSLog(@"title: %@",task.title);
  17.         NSLog(@"i:%i ",i);
  18.         i++;
  19.     }
  20. //////////////////////////////////////////////////////////
  21. output
  22. /////////////////////////////////////////////////////////
  23. 2013-03-17 19:31:08.462 tasky[2623:c07] title: (null)
  24. 2013-03-17 19:31:08.463 tasky[2623:c07] i:1
  25. 2013-03-17 19:31:08.464 tasky[2623:c07] title: (null)
  26. 2013-03-17 19:31:08.464 tasky[2623:c07] i:2
  27. 2013-03-17 19:31:08.465 tasky[2623:c07] title: (null)
  28. 2013-03-17 19:31:08.466 tasky[2623:c07] i:3
Advertisement
Add Comment
Please, Sign In to add comment