Re: NSTimer issue
Re: NSTimer issue
- Subject: Re: NSTimer issue
- From: Quincey Morris <email@hidden>
- Date: Wed, 5 Nov 2008 09:28:11 -0800
On Nov 5, 2008, at 08:51, Daniel Luis dos Santos wrote:
In the target argument I pass self, and as selector a method of the
class in question. When update is called, the self object has the
address I passed when creating the timer. Inside the method I call
setNeedsDisplay: so the drawRect method is called in the event loop.
That call never happens and only when I force the redrawing of the
view through dragging or overlapping windows, the drawRect is called
but with a different address on self.
I don't understand what is happening. Are there two instances ?
You already answered your own question. If you see two different
values for 'self' for two objects of your view subclass then of course
there are two instances.
This situation usually comes about when a view is created in code, and
a view of the same class is also added to a NIB file.
Note that, because the view you're actually controlling via the timer
(presumably the one created in code) doesn't draw, it probably hasn't
been added to a superview either. It sounds like you accidentally
created a new view instead of getting a reference to the one in the
NIB file using an IBOutlet.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
References: | |
| >NSTimer issue (From: Daniel Luis dos Santos <email@hidden>) |