Re: Lost variable
Re: Lost variable
- Subject: Re: Lost variable
- From: Bill Bumgarner <email@hidden>
- Date: Wed, 21 Oct 2009 11:25:12 -0700
On Oct 21, 2009, at 11:18 AM, Charlie Dickman wrote: What can be resetting the strings to nil? Is there something I can do in the debugger to catch any changes to the variables?
Are you sure you are talking to the same view?
I have seen many cases where a developer has been confused about nib instantiated objects vs. objects they instantiate. So... how is the view instantiated? If from the nib, you have an outlet to it and are sending messages to the value of that outlet?
(reply-to set to cocoa-dev as this is really a cocoa question. whole message excerpted below for context on that list)
b.bum
There's probably a really simple explanation for this but I'm at my wits' end...
I have acquired the source code for a subclass of a view that I am trying to use in my application. It is supposed to display the path name of a file. The variable that holds the path name is declared as an NSString * in the interface section of the .h file. After allocating and initing an instance of the view I set the path name via the setPathName procedure included in the subclass. For debugging purposes I retrieve the pathName via the pathName method and verify that it is as I set it.
However, when the drawRect procedure of the subclass is called the pathName is nil. I have inspected all of the code in the subclass to see if there is a method that sets the pathName to nil and there is none. I have placed breakpoints on every method in the subclass to catch any calls between setting the pathName and the invocation of the drawRect method and there are none.
There is another NSString *, that is setup in the initWithFrame method, to be used as the default pathName which is displayed when no pathName has been specified. When it is set in initWithFrame it retains its value but if I set it in the setPath method it too becomes nil by the time drawRect is called.
What can be resetting the strings to nil? Is there something I can do in the debugger to catch any changes to the variables?
Any help will be greatly appreciated.
Charlie Dickman email@hidden
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
References: | |
| >Lost variable (From: Charlie Dickman <email@hidden>) |