Obj-C language question: C function within @implementation
Obj-C language question: C function within @implementation
- Subject: Obj-C language question: C function within @implementation
- From: "Sean McBride" <email@hidden>
- Date: Thu, 3 Jul 2003 09:44:02 -0400
- Organization: Matrox Electronic Systems Ltd.
I'm no Obj-C expert, but I found some suspicious code that my Obj-C
newbie coworker wrote. I've reduced it to this example:
#import <Cocoa/Cocoa.h>
int main(int argc, const char *argv[])
{
return NSApplicationMain(argc, argv);
}
@interface MyClass : NSObject
{
IBOutlet NSProgressIndicator* progress;
}
@end
@implementation MyClass
void Function (void* thing)
{
MyClass* uc = (MyClass*)thing;
[uc->progress stopAnimation:uc];
}
@end
Notice that there is a C function within the @implementation block. This
compiles without error/warning with gcc and CodeWarrior. If I move this
outside the @implementation block CW gives an error and gcc gives a
warning (progress is protected), both of which make more sense IMHO.
Should this code compile as it is above? Seems to me progress is
protected no matter where Function() is.
Thanks!
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Mac Software Designer +1-514-822-6000
Matrox Electronic Systems Ltd. Montrial, Quibec, Canada
_______________________________________________
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.