• 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
Latent objects remain associated in NSTokenField after they are deleted/removed?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Latent objects remain associated in NSTokenField after they are deleted/removed?


  • Subject: Latent objects remain associated in NSTokenField after they are deleted/removed?
  • From: Honey Pot <email@hidden>
  • Date: Mon, 2 Mar 2009 15:26:24 -0800

Hello,

I have three token fields, each of which has a special case within

- (NSArray *)tokenField:(NSTokenField *)tokenField
completionsForSubstring:(NSString *)substring
		   indexOfToken:(int)tokenIndex
	indexOfSelectedItem:(int *)selectedIndex

for when one of the fields contains a value vs when one does not.

For Example..

If Field 1 contains a value

Then Field 2 bases its completions off a sub-set of data based on the
value from Field 1.

Like so:

=================
---Field 1 (Group X)
-----Field 2 (Users only from Group X)

Or

---Field 1 (Empty)
-----Field 2 (Users from All Groups)
=================

Also - (id)tokenField:(NSTokenField *)tokenField
representedObjectForEditingString: (NSString *)editingString

returns the corresponding object for each NSTokenField(Cell?).

------------
Problem:
------------

Whenever a value is entered into Field 1, then Field 2 searches based
off it. Whenever a value is removed from Field 1, or Field 2, or both,
Field 2 now ALWAYS searches based on the data that WAS in Field 1 (but
is no longer.) This still occurs even if I [ TokenField
setStringValue:@"" ]; .  From the UI perspective, the Field 1 token
field is empty, even programatically setting the field to be an empty
string, completionsForSubstring still acts as though there is a value
in Field 1, and follows the corresponding code path.

Here is how I check to see if there is a value in the field

if( [ [ TokenField objectValue ] count ] > 0 )

It works fine if I close the window & reopen it. But once a value is
committed to any field, it has the residual effect of impacting all
future completionsForSubstring, by effectively limiting the results to
only include Users from Group X, even when Field 1 is now "empty"
_______________________________________________

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

  • Prev by Date: Getting NSDate from EXIF of a image
  • Next by Date: Re: Logical and - second operator evaluated?
  • Previous by thread: Re: Getting NSDate from EXIF of a image
  • Next by thread: Latent objects remain associated in NSTokenField after they are deleted/removed?
  • Index(es):
    • Date
    • Thread