• 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: Populating a new SQLite Core Data store with default data
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Populating a new SQLite Core Data store with default data


  • Subject: RE: Populating a new SQLite Core Data store with default data
  • From: "Jon C. Munson II" <email@hidden>
  • Date: Mon, 23 Feb 2009 15:50:05 -0500
  • Organization: JTA Enterprises LLC

>
>   I meant:
>
> [(MyClassyClass *)obj doSomethingSpecificToMyClassyClass]
>
>   The cast needs to be applied to the pointer - obj - and not to the
> returned value (outside the [ ] square brackets).
>
> --
> I.S.

[Jon C. Munson II] That made a difference.  I took your literal word
originally.  :)

After adding @class anEntity; to the .h file (may not be necessary, but did
it anyway), and adding #import "anEntity.h" to the .m file, using:

	[(anEntity *)someObject setAttribute:@"somevalue"];

everything worked just peachy.  This uses the dynamic setter for the
anEntity class.

So, I'll switch from using the KVC calls to the casted calls to take
advantage of better efficiency.

Thank you, Quincey Morris, for your insight, I appreciate it.

I could not, however get this to work (and it may not be possible) with the
appropriate @class & #import:

	(anEntity *)someObject.attribute = @"somevalue";

Is there a way to implement that methodology as well?  Correct me if I'm
wrong, however, the dot syntax is the same as the dynamic setter, right?  To
use this methodology, does one then need to use the explicit someObject
instead of the generic version:

	// generic
	NSManagedObject someObject = [NSEntityDescription insert...];
	(anEntity *)someObject.attribute = @"somevalue";

	// explicit
	AnEntity *anEntity = [NSEntityDescription insert...];
	anEntity.attribute = @"somevalue";

Thanks I.S.!

Peace, Love, and Light,

/s/ Jon C. Munson II

_______________________________________________

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: Populating a new SQLite Core Data store with default data
      • From: "I. Savant" <email@hidden>
    • Re: Populating a new SQLite Core Data store with default data
      • From: Frédéric Testuz <email@hidden>
    • Re: Populating a new SQLite Core Data store with default data
      • From: Wim Lewis <email@hidden>
References: 
 >Populating a new SQLite Core Data store with default data (From: "Jon C. Munson II" <email@hidden>)
 >RE: Populating a new SQLite Core Data store with default data (From: "Jon C. Munson II" <email@hidden>)
 >Re: Populating a new SQLite Core Data store with default data (From: mmalc Crawford <email@hidden>)
 >RE: Populating a new SQLite Core Data store with default data (From: "Jon C. Munson II" <email@hidden>)
 >Re: Populating a new SQLite Core Data store with default data (From: mmalc Crawford <email@hidden>)
 >RE: Populating a new SQLite Core Data store with default data (From: "Jon C. Munson II" <email@hidden>)
 >Re: Populating a new SQLite Core Data store with default data (From: "I. Savant" <email@hidden>)
 >RE: Populating a new SQLite Core Data store with default data (From: "Jon C. Munson II" <email@hidden>)
 >Re: Populating a new SQLite Core Data store with default data (From: "I. Savant" <email@hidden>)

  • Prev by Date: Re: Question on threads running in my Foundation tool
  • Next by Date: Re: Populating a new SQLite Core Data store with default data
  • Previous by thread: Re: Populating a new SQLite Core Data store with default data
  • Next by thread: Re: Populating a new SQLite Core Data store with default data
  • Index(es):
    • Date
    • Thread