• 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: Need help with setNeedsDisplay - Another Update
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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:49:24 -0600

Here is te code from my AdsrView.m
- (void)updateAdsrValues: (float)attackStartFrameValueParam atav: (float)attackStartAmplitudeValueParam dsfv:(float) decayStartFrameValueParam
dsav:(float)decayStartAmplitudeValueParam ssfv:(float) sustainStartFrameValueParam
ssav:(float)sustainStartAmplitudeValueParam rsfv:(float) releaseStartFrameValueParam
rsav:(float)releaseStartAmplitudeValueParam refv:(float) releaseEndFrameValueParam raev:(float)releaseEndAmplitudeValueParam
{
attackStartFrameValue=attackStartFrameValueParam; NSLog (@"updateAdsrValues. attackStartFrameValue: %f", attackStartFrameValue);
attackStartAmplitudeValue=attackStartAmplitudeValueParam; NSLog (@"updateAdsrValues. attackStartAmplitudeValue: %f", attackStartAmplitudeValue);


			decayStartFrameValue=decayStartFrameValueParam;
			decayStartAmplitudeValue=decayStartAmplitudeValueParam;
			sustainStartFrameValue=sustainStartFrameValueParam;
			sustainStartAmplitudeValue=sustainStartAmplitudeValueParam;
			releaseStartFrameValue=releaseStartFrameValueParam;
			releaseStartAmplitudeValue=releaseStartAmplitudeValueParam;
			releaseEndFrameValue=releaseEndFrameValueParam;
			releaseEndAmplitudeValue=releaseEndAmplitudeValueParam;
			[self setNeedsDisplay:YES];
		}

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


References: 
 >Re: Need help with setNeedsDisplay - Another Update (From: Erik Buck <email@hidden>)
 >Re: Need help with setNeedsDisplay - Another Update (From: j o a r <email@hidden>)
 >Re: Need help with setNeedsDisplay - Another Update (From: Yevgeniy Goldberg <email@hidden>)
 >Re: Need help with setNeedsDisplay - Another Update (From: Andy Lee <email@hidden>)

  • Prev by Date: Re: Need help with setNeedsDisplay - Another Update
  • Next by Date: Re: Need help with setNeedsDisplay - Another Update
  • Previous by thread: Re: Need help with setNeedsDisplay - Another Update
  • Next by thread: Re: Need help with setNeedsDisplay - Another Update
  • Index(es):
    • Date
    • Thread