• 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 an auto incremented NSNumber as attribute in a NSManagedObject
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using an auto incremented NSNumber as attribute in a NSManagedObject


  • Subject: Re: Using an auto incremented NSNumber as attribute in a NSManagedObject
  • From: Joshua Preston <email@hidden>
  • Date: Thu, 6 Mar 2008 17:30:20 -0500

I.S.,

Hence the "don't use in production" clause. That method starts at 1 every time the application is launched, so not the complete solution in my case, it was only there as a reference to incrementing a value (arguably for my own use). The idea would be to persist that number in the data model.

Regards,

Joshua Preston
email@hidden




On Mar 6, 2008, at 4:52 PM, I. Savant wrote:

- (void)awakeFromInsert
{
  static int tempID = 1;

  [super awakeFromInsert];
  self.employeeID = [NSNumber numberWithInt:tempID++];
}

What do you think will happen when the application is quit, then run the next time? How will it remember the last tempID?

--
I.S.

_______________________________________________

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 an auto incremented NSNumber as attribute in a NSManagedObject (From: Joshua Preston <email@hidden>)
 >Re: Using an auto incremented NSNumber as attribute in a NSManagedObject (From: Joshua Preston <email@hidden>)
 >Re: Using an auto incremented NSNumber as attribute in a NSManagedObject (From: "I. Savant" <email@hidden>)

  • Prev by Date: Re: Deferring a selector until later, but before painting
  • Next by Date: Re: Using an auto incremented NSNumber as attribute in a NSManagedObject
  • Previous by thread: Re: Using an auto incremented NSNumber as attribute in a NSManagedObject
  • Next by thread: Re: Using an auto incremented NSNumber as attribute in a NSManagedObject
  • Index(es):
    • Date
    • Thread