title: How to get all records From CoreData Base using NSManagedObjectSubClass?
body: <p>I am trying to implement <code>CoreData</code> in <code>ios</code> Application,Now I want to Fetch all records from Entity <code>MUSTHAFA</code>  </p>
  
  <pre><code>  My  NSManagedObjectedSubClass is MUSTAHFA
  </code></pre>
  
  <p><strong>MUSTHAFA.m</strong></p>
  
  <pre><code>#import &lt;Foundation/Foundation.h&gt;
  #import &lt;CoreData/CoreData.h&gt;
  
  @interface MUSTHAFA : NSManagedObject {
  @private
  }
  @property (nonatomic, retain) NSString * FirstName;
  @property (nonatomic, retain) NSNumber * Age;
  @property (nonatomic, retain) NSString * Location;
  @property (nonatomic, retain) NSString * LastName;
  
  @end
  
  #import "MUSTHAFA.h"
  
  
  @implementation MUSTHAFA
  @dynamic FirstName;
  @dynamic Age;
  @dynamic Location;
  @dynamic LastName;
  
  @end
  </code></pre>
  
  <p><strong>Adding Records to Core Data</strong></p>
  
  <pre><code>-(void)AddRecordToCoreData{
  
      //NSLog(@"______ ADD Core Data Implementaion");  
      MUSTHAFA *event = (MUSTHAFA *)[NSEntityDescription insertNewObjectForEntityForName:@"MUSTHAFA" inManagedObjectContext:managedObjectContext];
      [event setLastName:@"JOHN"];
      [event setFirstName:@"JOSE "];
      [event setLocation:@"IDUKKI "];
      [event setAge:[NSNumber numberWithInt:25]];    
      NSError *error;
      if (![managedObjectContext save:&amp;error]) 
          {       
          NSLog(@"Error..%@",error);
      }
         else
         {
          NSLog(@"Data added to MUSTHAFA ");
         }      
  }
  </code></pre>
  
  <p>Retrieving all Values from Core Data just like select * from dbTable;</p>
  
  <pre><code>-(void)FetchRecordFromCoreData:(id)data1{
  
       //NSLog(@"______ Fetch Core Data Implementaion");  
      MUSTHAFA *event = (MUSTHAFA *)[NSEntityDescription insertNewObjectForEntityForName:@"MUSTHAFA" inManagedObjectContext:managedObjectContext];
  
     //USING event how can fetch all record from Data base;
  
  
  }
  </code></pre>
  
  <p>USING  event (Instance of MUSTAHFA) how can fetch all record from Data base?</p>