Hello,
I'm starting with CoreData and I have a question :
I have an array with NSNumber objects in it. I need to create an entity Event
for each object with only one attribute eventNumber
which should also be an NSNumber.
Can I pass the object of my array like this :
for (int i = 0, i<[myArray count], i++){
Event *newEvent = [NSEntityDescription insertNewObjectForEntityForName:@"Event" inManagedContext:managedContext];
[newEvent setEventNumber:[myArray objectAtIndex:i]]
}
[myArray release]
or is it necessary to create a new NSNumber like that :
for (int i = 0, i<[myArray count], i++){
Event *newEvent = [NSEntityDescription insertNewObjectForEntityForName:@"Event" inManagedContext:managedContext];
[newEvent setEventNumber:[NSNumber numberWithInt:[[myArray objectAtIndex:i] intValue]]
}
[myArray release]
Thank you for your help.
Leo