Re: Problem filing modified Sketch objects (Newbie)
Re: Problem filing modified Sketch objects (Newbie)
- Subject: Re: Problem filing modified Sketch objects (Newbie)
- From: Bob Ippolito <email@hidden>
- Date: Wed, 1 Jun 2005 01:15:19 -0700
On May 31, 2005, at 11:53 PM, J. Norvell wrote:
I've modified Mike Ferris's Sketch example so that the SKTGraphic
class has an
extra ivar, an NSMutableString. When I save and open a Sketch
document I can see
in the debugger that my instance variable has become "invalid" but
I can't figure
out what I'm doing wrong.
Your reference counting is not correct.
- (id)init {
... replace this:
[self setTheCellID:[[NSMutableString alloc]
initWithString:@"A01"]]; // ***
... with this:
NSMutableString *cellID = [[NSMutableString alloc]
initWithString:@"A01"];
[self setTheCellID:cellID];
[cellID release];
- (void)setCellID:(NSMutableString *)theCellID { // *** ADDED
Accessor method
... replace this:
_cellID = theCellID;
... with this:
[self setTheCellID:theCellID];
- (void)setTheCellID:(NSMutableString *)theCellID { // *** ADDED
Accessor method
... replace this:
if (_cellID != theCellID) {
_cellID = theCellID;
}
... with this:
[theCellID retain];
[_cellID release];
_cellID = theCellID;
-bob
_______________________________________________
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