On Sun, Jun 29, 2008 at 12:46 AM, Chris Purcell <[EMAIL PROTECTED]> wrote: > Hello, > Not sure where my problem is I've tried a few things and no success. I am > trying to output NSHTTPCookieStorage *cookies array to a table view. > Whenever I call the objectValueForTableColumn:row method the app errors > out, but if I leave it out the app launches displaying the correct number of > rows with nothing in it (as expected since I left out the other method). > > Here is the code to get the cookies array: > > NSHTTPCookieStorage* sharedCookieStorage = [NSHTTPCookieStorage > sharedHTTPCookieStorage]; > cookies = [sharedCookieStorage cookies] ; > > Here is the code to output the data to the table view: > > - (int)numberOfRowsInTableView:(NSTableView *)tableView > { > return [cookies count]; > }
Please read over the guide to Cocoa memory management: http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/Tasks/MemoryManagementRules.html In particular, if you're going to use the "cookies" array after the method where you fetch it, you must retain it. Mike _______________________________________________ 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]