NSTokenField needs a willDeleteObjects delegate API

Originator:apontious
Number:rdar://9000191 Date Originated:2/14/2011
Status:Closed Resolved:Duplicate/5686574
Product:Mac OS X Product Version:
Classification:Enhancement Reproducible:
 
Summary: NSTokenField needs some sort of tokenField:willDeleteObjects: delegate API.

See sample project for 

    http://openradar.appspot.com/radar?id=1129406

also attached here. {OpenRadar note: since OpenRadar does not support attachments, this cannot be attached to the OpenRadar version of this bug.}

In that project, I had to implement controlTextDidChange: and go through the contents of the field editor string just to figure out if any tokens had been deleted upon user edit. I needed to do this because, for this token field, duplicate tokens are not allowed. 

That's an unfortunate step, potentially fragile, that could be avoided if the token field would *tell* its delegates when it's going to delete tokens.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!