• 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
Using Core Data in Command Line utility
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using Core Data in Command Line utility


  • Subject: Using Core Data in Command Line utility
  • From: Paul Johnson <email@hidden>
  • Date: Mon, 8 Mar 2010 19:44:01 -0600

I've created an Xcode project using the Command Line Tool template
with the Type set to "Core Data".

I defined an Entity with 3 Properties. Two of the Properties are
strings and one is an integer (Int 16).

I fetch data from 3 files read from the internet and use a scanner
which extracts the strings. The integer is an index identifying the
file.

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

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

  • Follow-Ups:
    • Re: Using Core Data in Command Line utility
      • From: Jim Correia <email@hidden>
    • Re: Using Core Data in Command Line utility
      • From: Roland King <email@hidden>
  • Prev by Date: Re: short question but I don't know how to describe it
  • Next by Date: Re: Using Core Data in Command Line utility
  • Previous by thread: Re: Objective-C Garbage Collection problems
  • Next by thread: Re: Using Core Data in Command Line utility
  • Index(es):
    • Date
    • Thread