Re: Simple Newbie Question on Calling a Method
Re: Simple Newbie Question on Calling a Method
- Subject: Re: Simple Newbie Question on Calling a Method
- From: mmalcolm crawford <email@hidden>
- Date: Sat, 20 Dec 2003 12:59:12 -0800
On Dec 20, 2003, at 12:17 PM, Jerry Krinock wrote:
in Controller.h:
@interface Controller : NSObject
{
IBOutlet id sorterWindow ;
... // other outlets
}
- (void) bringSorterWindowToFront;
... // other method declarations
@end
in Controller.mm:
@implementation Controller
- (void)bringSorterWindowToFront
{
[sorterWindow makeKeyAndOrderFront: self];
}
.. // other method definitions
@end
in another .mm file, I call my function with the message:
[Controller bringSorterWindowToFront] ;
Result: It compiles OK, but upon running, I get:
No compiler warnings...?
You're sending the message to the class (Controller) not an instance.
<
http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/
3objc_language_overview/chapter_3_section_4.html>
You'll need means of accessing the relevant instance of Controller from
your other object -- typically through an outlet (instance variable).
mmalc
_______________________________________________
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.