Re: [Q] "auto"-incrementing integer attribute in awakeFromInsert
Re: [Q] "auto"-incrementing integer attribute in awakeFromInsert
- Subject: Re: [Q] "auto"-incrementing integer attribute in awakeFromInsert
- From: "Sean McBride" <email@hidden>
- Date: Wed, 18 Mar 2009 12:17:28 -0400
- Organization: Rogue Research Inc.
On 3/18/09 11:52 AM, Jon C. Munson II said:
>What happens is the attribute is set with the correctly incremented number.
>However, the tableview that is used to manage this entity displays two rows
>every time a new entity is inserted.
Fetching from awakeFromInsert is discouraged. There are some bugs/
problems. If you have an NSArrayController that will make use of the
object you're inserting (seems to be your case), it will receive
duplicate KVO notifications. Please file a bug with a repro case to Apple.
>So, my question is, how do I resolve the two-row error, or, is there a
>better way?
You're best bet is using performSelector:withObject:afterDelay: in
awakeFromInsert, that way you're not fetching in awakeFromInsert.
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
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