• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Using Core Data in Command Line utility
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using Core Data in Command Line utility


  • Subject: Re: Using Core Data in Command Line utility
  • From: Jim Correia <email@hidden>
  • Date: Mon, 8 Mar 2010 21:08:03 -0500

On Mar 8, 2010, at 8:44 PM, Paul Johnson wrote:

> 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”.

-setValue:forKey: takes an object for the value parameter. You have to pass an object - in this case our integer boxed in an NSNumber object.

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

You should also take a look Core Data’s dynamically generated accessor methods. These are typically what you should be using to set and access properties on your managed objects.

Jim

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden

References: 
 >Using Core Data in Command Line utility (From: Paul Johnson <email@hidden>)

  • Prev by Date: Re: Using Core Data in Command Line utility
  • Next by Date: NSImage change of behaviour?
  • Previous by thread: Re: Using Core Data in Command Line utility
  • Next by thread: NSImage change of behaviour?
  • Index(es):
    • Date
    • Thread