Again thank you for the reply. Thanks to the column identifier, I am able to see data in the table view! However, when I attempt to click on a row or scroll down I receive an error in the console.

"-[NSURL objectAtIndex:]: unrecognized selector sent to instance 0x10edd0"

I've tried with different column identifiers (name, value, created, etc.) and no luck. Am I not returning the cookie correctly, should I returning them as specific types of data, like you noted in your first reply?

How would I return domain for example?

Thank you!



On Jun 29, 2008, at 11:31 PM, Jens Alfke wrote:


On 29 Jun '08, at 9:47 PM, Chris Purcell wrote:

Thank you for the reply. I am a bit of a Cocoa newbie and I'm having trouble using the objectValueForTableColumn:. My NSTableView is only one column, but I would like to display all attributes of each key.

You should have one column per attribute. If you look at any typical table display (in Mail, or the Finder, or iTunes...) you'll see that each column shows one attribute of the message/file/song.

This is an example of what is outputting when I display a entry of the NSArray: <NSHTTPCookie version:0 name:@"SC" value:@"RV=661339" expiresDate:@"2038-01-17 11:14:07 -0800" created:@"236061243.432815" sessionOnly:FALSE domain:@".google.com" path:@"/finance" secure:FALSE comment:@"(null)" commentURL:@"(null)" portList:(null)>
Is this a dictionary?

No, that's just the string that an NSHTTPCookie object returns from its -description method.

What would be the easiest way to display each one of the attributes of the dictionary (version, name, value, etc.) in a separate column? How could I return just one of the attributes?

If you just want to display the domain, then return [cookie domain]. If you want to return the path, return [cookie path]. Et cetera.

A common trick is to set the "identifier" property of each table column (in IB) to be a property name. Then your - objectValueForTableColumn method can get the object for the row and call -valueForKey: on it, using the column identifier, like:

NSHTTPCookie *cookie = [_cookies objectAtIndex: row];
NSString *identifier = [column identifier];
return [cookie valueForKey: identifier];

—Jens

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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]

Reply via email to