• 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: How to avoid excessive hard coding when programatically inserting Core Data entity ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to avoid excessive hard coding when programatically inserting Core Data entity ?


  • Subject: Re: How to avoid excessive hard coding when programatically inserting Core Data entity ?
  • From: Shawn Erickson <email@hidden>
  • Date: Sun, 16 Sep 2007 08:01:39 -0700


On Sep 16, 2007, at 7:38 AM, Erik Buck wrote:

Does anyone have suggestions for how to reduce the amount of hard coding going on ?

Not knowing exactly what you mean by hard coding in this context...

@implementation VT4ImageGraphic (VT4Utility)

+ (VT4PointVector*) pointVectorWithPoint:(NSPoint)aPoint inContext: (NSManagedObjectContext*)
{
// Create an entity to store the position of the image
VT4PointVector *newPoint = [NSEntityDescription insertNewObjectForEntityForName:@"VT4PointVector"
inManagedObjectContext:aManagedObjectContext];
[newPoint setX:[NSNumber numberWithFloat:aPoint.x]];
[newPoint setY:[NSNumber numberWithFloat:aPoint.y]];
}


etc.

+ (void)insertWithImage:(NSImage *)anImage atPoint:(NSPoint)aPoint inManagedObjectContext:(NSManagedObjectContext *)aManagedObjectContext
{
if(nil != anImage)
{
NSAssert(nil != aManagedObjectContext, @"Invalid managed object context");

VT4PointVector* point = [self pointVectorWithPoint:aPoint inContext: aManagedObjectContext];


etc.
_______________________________________________

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: How to avoid excessive hard coding when programatically inserting Core Data entity ?
      • From: Shawn Erickson <email@hidden>
References: 
 >How to avoid excessive hard coding when programatically inserting Core Data entity ? (From: Erik Buck <email@hidden>)

  • Prev by Date: Re: Singletons and Threads
  • Next by Date: Re: NSTextView, partial views of NSTextStorage
  • Previous by thread: How to avoid excessive hard coding when programatically inserting Core Data entity ?
  • Next by thread: Re: How to avoid excessive hard coding when programatically inserting Core Data entity ?
  • Index(es):
    • Date
    • Thread