Re: Adding data to a TableView
Re: Adding data to a TableView
- Subject: Re: Adding data to a TableView
- From: Bill Cheeseman <email@hidden>
- Date: Fri, 21 Jun 2002 12:45:32 -0400
on 02-06-21 12:13 PM, Jeremy Dronfield at email@hidden wrote:
>
I've got a feeling I'm missing something eye-poppingly obvious. Can
>
anyone explain what's going wrong with the following code? I can't get
>
it to work (either signal 6, signal 10 or signal 11, or just no response
>
at all). I've included some of the 'commented out' alternative bits of
>
code I've tried.
>
>
#import "MyController.h"
>
>
@implementation MyController
>
>
- (id)init
>
{
>
[super init];
>
bookmarks = [[NSMutableArray alloc] init];
>
/*[(NSMutableArray *)bookmarks init];*/
>
[bookmarks retain];
>
totalSegments = 4;
>
return self;
>
}
I don't have time to look at all your code, but this stuck out. You've
retained bookmarks twice, once in the alloc call (which automatically
retains the new object), and again explicitly. You don't need the explicit
retain.
Also, I note that your dealloc call does nothing but call super. I think you
need to release bookmarks in the dealloc method, unless you do it somewhere
else that I overlooked.
So it looks like you're leaking memory. Not sure why that would cause
errors, though, unless you're running a really big bookmarks collection.
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com
The AppleScript Sourcebook -
http://www.AppleScriptSourcebook.com
Vermont Recipes -
http://www.stepwise.com/Articles/VermontRecipes
Croquet Club of Vermont -
http://members.valley.net/croquetvermont
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.