Re: Newbie question: chrash on [tableview reloadData]
Re: Newbie question: chrash on [tableview reloadData]
- Subject: Re: Newbie question: chrash on [tableview reloadData]
- From: Terje Tjervaag <email@hidden>
- Date: Thu, 21 Nov 2002 19:25:39 +0000
Thanks for that, but I don't think that's my problem. I have after
much ado managed to figure out where the crash happens. Well, almost
at least. All the code I have written finished without a hitch, but if
I continue stepping past that, the stack comes to a call that's named
"[NSControl mouseDown:]", and that's where I'm getting a
"EXC_BAD_ACCESS" in the debugger.
Still apologise for providing so little solid material on this.. And
still hoping that someone might be able to help me.. :-)
t.
On Thursday, November 21, 2002, at 06:03 PM, email@hidden wrote:
Probably the object that you are loading into the row is being
disposed
of after the init method. If you are using a class method like
NSDictionary *myDict = [NSDictionary dictionaryWithContentsOfFile:path]
this gets automatically disposed of after the routine finishes unless
you
retain the object like this
[myDict retain];
This is what causes most type 10 and 11 errors..
I dont know how or what you are loading in from a file but principal
is
that same.
Class objects are autoreleased on exit form a routine unless retained
Have a look thru the cocoa dev archives here
http://cocoa.mamasam.com/index.php
or on apple for some more stuff on memory retention or here for another
article on the same thing
http://everything2.com/index.pl?node=Cocoa Paradigms
Terje Tjervaag <email@hidden>
Sent by: email@hidden
21/11/02 05:14 pm
To: email@hidden
cc:
Subject: Newbie question: chrash on [tableview
reloadData]
Hi people,
Excuse me for the probably very easy question here, but I seem to keep
hitting my head against the wall on this and it's getting more and more
annoying.
I am working through Aron Hillegass' book Cocoa Programming for Mac OS
X, and am currently on a section which involves an NSTableView. The
application I create from his tutorial works fine, but when I try to
create my own from scratch it just crashes whenever I call reloadData
on the tableview. I have made my own little file class, containing two
strings, the file name and a description. The application is a
document application and in my document init method I can create a new
file and insert it into the NSMutableArray I use as the datasource for
the tableview. When the application loads it displays this row fine,
but when I try to call reloadData AFTER that, even though I have not
added any objects to my array, the application crashes with a "due to
signal 10 (SIGBUS)".
Does anyone have ANY clue as to what can be causing this? I would give
you more details, but I haven't got a clue whats going on here.
Any help appreciated,
Terje
_______________________________________________
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.
***********************************************************************
***********
This email may contain confidential material. If you were not an
intended recipient, please notify the sender and delete all copies.
We may monitor email to and from our network.
_______________________________________________
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.
_______________________________________________
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.