Re: fundamental question: how do I call controller methods from other classes?

2008-05-22 Thread Hamish Allan
On Thu, May 22, 2008 at 1:07 AM, Matthew Youney <[EMAIL PROTECTED]> wrote: > What am I missing? Adam Leonard's reply is an excellent description of the concepts you need to understand first and foremost. But if I understand your purposes correctly from your classnames, once you have a better gras

Re: fundamental question: how do I call controller methods from other classes?

2008-05-22 Thread Sherm Pendley
I've no idea what books you've been reading or what questions you've been asking, but MVC as it applies to Cocoa is pretty well described on this page: < http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/CocoaDesignPatterns/chapter_5_section_4.html > Which, of course

RE: fundamental question: how do I call controller methods from other classes?

2008-05-22 Thread Matthew Youney
A! This is quite interesting. Have I been reading the wrong books, asking the wrong questions or both? This can be quite a powerfull tool! Again, thanks, Matt On 21 May '08, at 8:15 PM, Matthew Youney wrote: > I just have no mechanism of sending messages > to my "controller" class f

RE: fundamental question: how do I call controller methods from other classes?

2008-05-22 Thread Matthew Youney
Hal, The controller instance is created by the IB. All I wanted to do is to be able to call accessor methods on the controller (from other classes) to manipulate the GUI (encapsulate the GUI stuff). I thought that this would be a normal thing to do, but I guess not. I kinda think wiring sockets a

Re: fundamental question: how do I call controller methods from other classes?

2008-05-21 Thread Graham Cox
On 22 May 2008, at 3:53 pm, Johnny Lundy wrote: Oh, I have no problem invoking API methods that are built-in to Cocoa. It's dealing with two of my own classes that I never understood. OK, well alright, here's the secret: there is no difference! I was referring to something like the followi

Re: fundamental question: how do I call controller methods from other classes?

2008-05-21 Thread Jens Alfke
On 21 May '08, at 9:42 PM, Johnny Lundy wrote: I still don't know how to call one class from another (the reason I always only have one class in my projects) Yow! That's kind of a fundamental issue. Sort of like "I still don't know how knights move, so I just leave them where they started.

Re: fundamental question: how do I call controller methods from other classes?

2008-05-21 Thread Adam Leonard
ot;controller" makes the call. I guess I just have to get my head around it, and design appropriately. Again, thanks so much for your help, Matt -Original Message- From: Jens Alfke [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 21, 2008 10:06 PM To: [EMAIL PROTECTED] Cc: cocoa-dev@lis

Re: fundamental question: how do I call controller methods from other classes?

2008-05-21 Thread Graham Cox
On 22 May 2008, at 2:42 pm, Johnny Lundy wrote: I still don't know how to call one class from another (the reason I always only have one class in my projects) You just need a reference to the other class. That might be something you've created, or obtained from somewhere else. Example.

Re: fundamental question: how do I call controller methods from other classes?

2008-05-21 Thread Jens Alfke
On 21 May '08, at 8:15 PM, Matthew Youney wrote: I just have no mechanism of sending messages to my "controller" class from my "model" objects unless the "controller" makes the call. Typically the model doesn't "know about" the controller (or the view). Instead it posts notifications whe

fundamental question: how do I call controller methods from other classes?

2008-05-21 Thread Johnny Lundy
to make an IBOutlet for it to refer to it from code. On May 21, 2008, at 8:40 PM, [EMAIL PROTECTED] wrote: Message: 8 Date: Wed, 21 May 2008 20:07:05 -0400 From: "Matthew Youney" <[EMAIL PROTECTED]> Subject: fundamental question: how do I call controller methods from

Re: fundamental question: how do I call controller methods from other classes?

2008-05-21 Thread Hal Mueller
Make sure you understand nil-targeted actions/File's Owner/responder chain. That idiom might or might not be useful in this case. I can picture sending various messages to nil that only the POSSocket class will respond to, and have the POSSocket instance be the delegate of your controller.

RE: fundamental question: how do I call controller methods from other classes?

2008-05-21 Thread Matthew Youney
10:06 PM To: [EMAIL PROTECTED] Cc: cocoa-dev@lists.apple.com Subject: Re: fundamental question: how do I call controller methods from other classes? On 21 May '08, at 5:07 PM, Matthew Youney wrote: > The name of the controller object in interface builder is > myPOSsocketCon

Re: fundamental question: how do I call controller methods from other classes?

2008-05-21 Thread Jens Alfke
On 21 May '08, at 5:07 PM, Matthew Youney wrote: The name of the controller object in interface builder is myPOSsocketController, and the following gives the compiler error "myPOSsocketController undeclared or first use in function" If you want an object in a nib to know about another one, th

Re: fundamental question: how do I call controller methods from other classes?

2008-05-21 Thread Shawn Erickson
On Wed, May 21, 2008 at 5:26 PM, Shawn Erickson <[EMAIL PROTECTED]> wrote: To be clearer... I am suggesting you review the whole chapter I linked below not just the first section of it looking primarily for discussion of outlets (IBOutlet) and actions.

Re: fundamental question: how do I call controller methods from other classes?

2008-05-21 Thread Shawn Erickson
On Wed, May 21, 2008 at 5:07 PM, Matthew Youney <[EMAIL PROTECTED]> wrote: > What is the instance name of the controller object instantiated by Interface > Builder? They do not have a name... at least not in the way you appear to be asking. Objects in the nib or external objects (file owner, etc

fundamental question: how do I call controller methods from other classes?

2008-05-21 Thread Matthew Youney
This is a very basic question: How do I call controller methods from other classes? Or even a more basic question: What is the instance name of the controller object instantiated by Interface Builder? I am am new to Cocoa, however a career programmer, and I am feeling quite dumn here. I am obvio