Lost variable
Lost variable
- Subject: Lost variable
- From: Charlie Dickman <email@hidden>
- Date: Wed, 21 Oct 2009 14:18:45 -0400
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