On Tuesday, December 22, 2009, Gerriet M. Denkmann <[email protected]> wrote: > What I ended up was: subclassing NSArrayController and overriding "newObject" > to return a new object prefilled with some some nice values, including > setting my uniqueKey to "undefined", "undefined_1", "undefined_2", etc. > This will break of course if the user (out of sheer perversity) has already > created an "undefined_4". Plus 1. I've done something similar in the past. My approach was to see if "Untitled" was already taken, if so try "Untitled 2", etc. From memory I kept going until 20 (a number all but the most perverse user wouldn't reach in my case). If "Untitled 20" (& everything preceding) was taken it got named with a date stamp, "Untitled 2009122215353803" for example.
Regards, Matt _______________________________________________ Cocoa-dev mailing list ([email protected]) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
