Re: Crash when calling custom methods in custom subclass.
Re: Crash when calling custom methods in custom subclass.
- Subject: Re: Crash when calling custom methods in custom subclass.
- From: mmalcolm crawford <email@hidden>
- Date: Sat, 30 Jul 2005 13:01:44 -0700
On Jul 30, 2005, at 12:01 PM, Adam Raney wrote:
Thanks for you help guys, I;ve gotten a bit closer to solving my
problem. It seems I can't simply call an instance of a custom class by
making a variable with it as I had before:
ACRQuizProblemRowElement *newElement;
But instead needed to explicity allocate and initialize it:
ACRQuizProblemRowElement *newElement = [[ACRQuizProblemRowElement
alloc] init];
Also taking your advice, my setters now utilize this format:
- (void) setContent: (NSString *)newContent
{
[_content release];
_content = [newContent copy];
}
This works fine in most situations, except when I am trying to set
the array.
- (void) setAnswers: (NSArray *)newAnswers
{
[_answers release];
_answers = [NSArray copy];
}
It's not clear why you're not following the implementation pattern
clearly set out in the documentation and in other references?
mmalc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden