1

every thing works fine but i get this notice

and try to search to find solution but with no luck

AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication]delegate];
NSManagedObjectContext *context = appDelegate.managedObjectContext ;
NSString *title = [[Picker delegate]pickerView:Picker titleForRow:[Picker selectedRowInComponent:1] forComponent:1];

NSEntityDescription *entity = [NSEntityDescription insertNewObjectForEntityForName:@"History" inManagedObjectContext:context];
Bosoud
  • 158
  • 4
  • 24

1 Answers1

2

In this line:

NSEntityDescription *entity = [NSEntityDescription insertNewObjectForEntityForName:@"History" inManagedObjectContext:context];

The method you're calling returns an instance of NSManagedObject. You are assigning it to a variable of type NSEntityDescription. That's what the message is telling you.

Tom Harrington
  • 69,312
  • 10
  • 146
  • 170
  • So how to declare the NsEntityDescription – Bosoud Apr 09 '16 at 23:04
  • You can look it up in the `NSManagedObjectModel`, but this is rarely necessary or useful. What are you trying to do here? It looks like you want to create a new instance of the entity. If so then you're doing everything right *except* using the wrong variable type on that line. The line creates an `NSManagedObject`, which is what it looks like you want. – Tom Harrington Apr 09 '16 at 23:07