• 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: custom view won't update
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: custom view won't update


  • Subject: Re: custom view won't update
  • From: H M <email@hidden>
  • Date: Tue, 11 Sep 2007 13:16:17 +0100

It seems a little strange that an NSView subclass has IBActions/ IBOutlets... yet the above code seems to imply that.

hm, come to think of it, i'd say you're right, they should be in a controller class. that means i have to access the variables using accessor methods, but that shouldn't be a problem. the question is, how do I get that controller class to update my view?


Can you please outline which classes contain which methods and which is the NSView subclass? Also can you describe how they are connected / instantiated in the nib?

the NSView subclass is called Sky, and it contains the 3 action methods, the 3 outlets, drawRect: and all the necessary variables, mostly double.
in InterfaceBuilder I subclassed NSView, renamed the new class, added the outlets and the actions, then I instantiated it and connected the sliders to their methods and outlets. after that, i created the files and went back to xcode.


Given what you have posted so far I believe you are not sending the setNeedsDisplay: message to an instance of your view that is actually in the view hierarchy of your window but one that is either instantiated off by itself in the nib or instantiated in code (and not the one in the view hierarchy).

that would explain why it doesn't work. I'm gonna try to find out... _______________________________________________

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


  • Follow-Ups:
    • Re: custom view won't update
      • From: Shawn Erickson <email@hidden>
    • Re: custom view won't update
      • From: Paul Bruneau <email@hidden>
    • Re: custom view won't update
      • From: H M <email@hidden>
References: 
 >custom view won't update (From: H M <email@hidden>)
 >Re: custom view won't update (From: Shawn Erickson <email@hidden>)
 >Re: custom view won't update (From: H M <email@hidden>)
 >Re: custom view won't update (From: "I. Savant" <email@hidden>)
 >Re: custom view won't update (From: H M <email@hidden>)
 >Re: custom view won't update (From: Shawn Erickson <email@hidden>)

  • Prev by Date: Re: keyboard events
  • Next by Date: Re: custom view won't update
  • Previous by thread: Re: custom view won't update
  • Next by thread: Re: custom view won't update
  • Index(es):
    • Date
    • Thread