• 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 16:04:13 -0700


On Jul 30, 2005, at 3:38 PM, mmalcolm crawford wrote:

But either way I get a "EXC_BAD_ACCESS" from Debugger when I reach the
end of the addHeaderRow: method.
What invokes addHeaderRow:, and how is it implemented?


From your original post:

On Jul 28, 2005, at 7:34 PM, Adam Raney wrote:

ACRQuizProblemRowElement *newElement;
[newElement setContent: newContent];
[newElement setFormat: newFormat];
[newElement setAnswers: newAnswers];
[newElement setIsHeader: newIsHeader];

You never create an instance of ACRQuizProblemRowElement. Declaring a variable is not the same as creating an instance.

You need something along the lines of:

ACRQuizProblemRowElement *newElement =
    [[ACRQuizProblemRowElement alloc] init];

The memory management issues will depend on what you do with the object thereafter. In your original example you simply declare a local variable then exit the method having done nothing with it to make it permanent.

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


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>)
 >Re: Crash when calling custom methods in custom subclass. (From: mmalcolm crawford <email@hidden>)
 >Re: Crash when calling custom methods in custom subclass. (From: mmalcolm crawford <email@hidden>)
 >Re: Crash when calling custom methods in custom subclass. (From: mmalcolm crawford <email@hidden>)

  • Prev by Date: Re: Crash when calling custom methods in custom subclass.
  • Next by Date: Re: NSSegmentedControl Display Bug?
  • 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