Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Crash when calling custom methods in custom subclass.




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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

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>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.