Re: Debugging - Finding when a value changed
Re: Debugging - Finding when a value changed
- Subject: Re: Debugging - Finding when a value changed
- From: Roarke Lynch <email@hidden>
- Date: Mon, 22 Jul 2002 12:32:03 -0400
It sounds to me like you are either not retaining the object or allowing
it to be mutable. I'll put more faith on the second, b/c you prob get an
error trying to refer to an unretained object later on. Assuming this is
a sub-classed object, check your methods.
- (id)val {
return [[val copy] autorelease];
}
- (void)setVal:(id)newVal {
[val autorelease];
val = [newVal copy];
}
this would be the safe way to return and set the variable within your
object. as opposed to
- (id)val {
return val;
}
which returns your actual object and allows anything to change the value
of an internal variable within your object, without your object's
knowledge.
On Monday, July 22, 2002, at 03:32 AM, David Newberry wrote:
Hello all,
I'm having trouble tracking down a bug. I have an object with an
instance variable, and that variable has the correct value when the
object is created. However, later on in the program, the value has
changed, and I cannot for the life of me figure out where it changes.
Is there any way to say to PB, "Watch this variable, and drop into the
debugger when it changes"? Any other suggestions are also welcome. :)
Roarke Lynch
-------------------------------
email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.