• 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: Debugging - Finding when a value changed
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Debugging - Finding when a value changed (From: David Newberry <email@hidden>)

  • Prev by Date: Re: Debugging - Finding when a value changed
  • Next by Date: Disable Power Management ?
  • Previous by thread: Re: Debugging - Finding when a value changed
  • Next by thread: [ANN] PSProcess
  • Index(es):
    • Date
    • Thread