Re: Need help with setNeedsDisplay - Another Update
Re: Need help with setNeedsDisplay - Another Update
- Subject: Re: Need help with setNeedsDisplay - Another Update
- From: Yevgeniy Goldberg <email@hidden>
- Date: Sat, 10 Mar 2007 20:57:41 -0600
I was not deleting the entire custom view, only it's instance in the
nib file.
When this instance is present in the nib file, drawRect will work,
but only after window is resized.
Here is the output of one app run:
2007-03-10 20:53:18.456 SoundTemplate05[1299] awoke 0x3982e0
2007-03-10 20:53:18.456 SoundTemplate05[1299] awoke 0x39d380
2007-03-10 20:53:18.456 SoundTemplate05[1299] awoke 0x39cd70
As you have suggested, I've put the NSLog into a blank awakeFromNib
of my custom view class
I'm not sure how I could use the po command in the debuger since I do
not have this custom view defined as IBOutlet
On Mar 10, 2007, at 8:43 PM, Andy Lee wrote:
On Mar 10, 2007, at 5:24 PM, Yevgeniy Goldberg wrote:
Getting rid of an instance of my custom view in the nib file did
not help.
In fact, after I deleted that instance from the nib nothing was
redrawing even after the window resize.
I am confused about the structure of your app. How could deleting
the custom view cause the custom view to correctly redraw, if it's
no longer there?
In any case, I'm sure you/we will get to the bottom of this!
You're *positive* you are calling setNeedsDisplay: where you think
you are? If you put an NSLog before and after it, you see the log
output? (Or you could use a breakpoint as Nick suggested.)
And are you positive drawRect: is *not* getting called? Can you
confirm this with a breakpoint or NSLog?
And you're positive the instance of the view that you're sending
setNeedsDisplay: to is the right instance? You could add an
awakeFromNib method to the custom view that just does this:
NSLog(@"awoke 0x%x", self);
And just before you call [self setNeedsDisplay:] you could do this:
NSLog(@"needs display: 0x%x", self);
And make sure the printed addresses are the same.
As a very blunt, "dumb" test, what if you add a button (or change
the action of an existing one) such that the target is the custom
view and *all* the action does is setNeedsDisplay:YES? Surely
drawRect: should get called then? (You'll need a breakpoint or
NSLog to confirm this, because no data will have changed.)
--Andy
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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