Problems with NSTokenView (again) - using objectvalue <p>In my Swift Application for Mac OS X, I'm using a <a href="https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSTokenField_Class/" rel="nofollow">NSTokenField</a>. I'm using, among others, the delegate methods <code>tokenField(tokenField: NSTokenField, representedObjectForEditingString editingString: String) -&gt; AnyObject</code> and <code>tokenField(tokenField: NSTokenField, displayStringForRepresentedObject representedObject: AnyObject) -&gt; String?</code> to work with represented objects. My represented objects are instances of a custom class.</p> <p>From the <a href="https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/TokenField_Guide/GetSetTokenFields/GetSetTokenFields.html#//apple_ref/doc/uid/TP40006555-CH9-SW2" rel="nofollow">Apple Documentation</a>, I know that <code>objectValue</code> can be used to access the represented objects of a <code>NSTokenView</code> as a <code>NSArray</code>:</p> <blockquote> <p>To retrieve the objects represented by the tokens in a token field, send the token field an <code>objectValue</code> message. Although this method is declared by <code>NSControl</code>, <code>NSTokenField</code> implements it to return an array of represented objects. If the token field simply contains a series of strings, <code>objectValue</code> returns an array of strings. To set the represented objects of a token field, use the <code>setObjectValue</code>: method, passing in an array of represented objects. If these objects aren’t strings, <code>NSTokenField</code> then queries its delegate for the display strings to use for each token.</p> </blockquote> <p>However, this doesn't seem to work for me. <code>let tokenArray = self.tokenField.objectValue! as! NSArray</code> does return a NSArray, but it is empty, even though the delegate method required to return a represented object has been called the appropriate amount of times before.</p> <p><code>NSTokenView</code> doesn't seem like a particularly strong tool to work with tokenization, but, lacking an alternative, I hope that you guys can help me making my implementation work.</p> <p>Thanks in advance!</p>