• 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: Variables: Why one way and not another?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Variables: Why one way and not another?


  • Subject: Re: Variables: Why one way and not another?
  • From: "Alastair J.Houghton" <email@hidden>
  • Date: Sat, 1 Nov 2003 21:43:00 +0000

On Saturday, November 1, 2003, at 09:23 pm, Brian Christensen wrote:

On Nov 1, 2003, at 11:38 AM, Robert Borsuk wrote:

Woohoo. Okay, thanks Andreas, Alastair (and his project) and Uli. I got it solved. Here's what I was doing wrong. When I made the nib I instantiated the subclass in IB so I could connect my buttons actions to it. Wrong. I should have just connected the button to the view. This fixed the problems. It was weird because the action would be called. Then it dawned on me with what Andreas said. I guess I was actually creating two instances (one in the window and one I instantiated. Life is good once again and my variables now work.
Thanks for everyones help.

You really shouldn't be connecting your buttons to your view though. Create a controller class instead.

I nearly said that myself (as well as the comment I did make about the view being the application object's delegate), but I can think of a few cases where it might be acceptable... a "refresh" button, for example, or a button that has the same functionality as some action the user can perform via the view (i.e. where the code could be shared).

Kind regards,

Alastair.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Variables: Why one way and not another? (From: Brian Christensen <email@hidden>)

  • Prev by Date: Re: My app crashes on Panther randomly
  • Next by Date: Re: Mail hacking?
  • Previous by thread: Re: Variables: Why one way and not another?
  • Next by thread: Re: Variables: Why one way and not another?
  • Index(es):
    • Date
    • Thread