• 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: mark added object in NSArrayController as "dirty"?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mark added object in NSArrayController as "dirty"?


  • Subject: Re: mark added object in NSArrayController as "dirty"?
  • From: Keary Suska <email@hidden>
  • Date: Thu, 28 Aug 2008 08:47:10 -0600
  • Thread-topic: mark added object in NSArrayController as "dirty"?

8/27/08 6:46 PM, also sprach email@hidden:

> I've got a simple detail view backed by an NSArrayController. The view views
> the NSArrayController's selection. The NSArrayController manages an array of
> dictionaries, all very simple.
>
> I've implemented validateValue:... and it's being called when I want it to
> be (thanks to "validates immediately"), except on this one occasion:
>
> The user can create a new object - the button calls add:, and I've
> overridden newObject:. However, this new object is deliberately invalid;
> some fields are blank, but the user must fill them in before leaving and
> moving to another selection. That's the intention, anyway. The problem is
> that that is not happening; the user can press the selectPrevious: button
> without doing any editing, and no validation takes place. Obviously that's
> because the user didn't do any editing!
>
> How can I fool the system into thinking the user has done some editing in
> every field, so that when the user leaves this selection for another, every
> field will be validated? m.

AFAIK, you can't. And, AFAIK, simply entering a field is enough to trigger
editing, so if you set the first blank field as as first responder,
validation should be called on end editing. But just for that field,
unfortunately.

My understanding is that validation is done on a per-field basis by the
field editor--i.e. There is no "edited" flag. Since there is just one field
editor etc. You get the idea.

The only solution I have found is intercepting all actions that would move
away from the displayed "record", and manually call validation.

HTH,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"


_______________________________________________

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: 
 >mark added object in NSArrayController as "dirty"? (From: Matt Neuburg <email@hidden>)

  • Prev by Date: Re: Creating Interface
  • Next by Date: Semi-transparent offscreen CALayer
  • Previous by thread: mark added object in NSArrayController as "dirty"?
  • Next by thread: Re: mark added object in NSArrayController as "dirty"?
  • Index(es):
    • Date
    • Thread