Paul Johnson wrote:

In the innermost scanner loop, I am trying to use
NSEntityDescription
insertNewObjectForEntityForName:inManagedObjectContext, to create an
NSManagedObject which I then want to populate with the two strings and
the integer using [object setValue:forKey:]

The problem I'm having is the line that tries to store the integer:
[object setValue:i forKey:@"fileIndex"];

I get the compiler error "Passing argument 1 of 'setValue"forKey'
makes pointer from integer without a cast".

Can anyone tell me how to fix this? I'm also wondering if I'm using
the correct methods to accomplish the task.
_______________________________________________

setValue:forKey takes an id (NSObject*) not an integer. You need to wrap your integer into an NSNumber, [ NSNumber numberWithInt:i ] and set that.
_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to