• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Crash when calling custom methods in custom subclass.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Crash when calling custom methods in custom subclass.
      • From: mmalcolm crawford <email@hidden>
References: 
 >Crash when calling custom methods in custom subclass. (From: Adam Raney <email@hidden>)
 >Re: Crash when calling custom methods in custom subclass. (From: Charilaos Skiadas <email@hidden>)
 >Re: Crash when calling custom methods in custom subclass. (From: Adam Raney <email@hidden>)
 >Re: Crash when calling custom methods in custom subclass. (From: Adam Raney <email@hidden>)

  • Prev by Date: Re: Key event loop malfunction
  • Next by Date: Re: QTKit QTMovieView behavior
  • Previous by thread: Re: Crash when calling custom methods in custom subclass.
  • Next by thread: Re: Crash when calling custom methods in custom subclass.
  • Index(es):
    • Date
    • Thread