Re: NSView -subviews ordering?
Re: NSView -subviews ordering?
- Subject: Re: NSView -subviews ordering?
- From: Ondra Cada <email@hidden>
- Date: Wed, 29 May 2002 23:33:17 +0200
On Wednesday, May 29, 2002, at 11:26 , Brock Brandenberg wrote:
void fnc(void) { ... }
....
@implementation Blah
....
void fnc2(void) { ... }
....
@end
Both cases are perfectly all right.
That's good to know. The Obj-C book doesn't really elaborate on this, so
I assumed that only class and instance methods were allowed in an
implementation. If you wanted to access the function from outside of the
class (such as call it from elsewhere), would being within the
@implementation/@end hide the function since it lies within the class'
namespace? What kind of scope does it have when inside the implementation?
Nooo, you are overcomplicating things. This is ObjC, not C++ ;)
The rule is simple: all functions work *exactly* as if there are no @...
directives. Regardless where they are, functions are still plain ole C.
Incidentally, did you know you can send messages from them? Eg. this is
perfectly valid:
@implementation Foo
static void bar(id self) {
[self whatever]; // makes a nice cosy infinite loop...
}
-(void)whatever {
bar(self);
}
@end
;) Well, don't you just love ObjC?
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
2K Development: email@hidden
http://www.2kdevelopment.cz
private email@hidden
http://www.ocs.cz/oc
_______________________________________________
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.