• 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: NSView -subviews ordering?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: NSView -subviews ordering?
      • From: Brock Brandenberg <email@hidden>
References: 
 >Re: NSView -subviews ordering? (From: Brock Brandenberg <email@hidden>)

  • Prev by Date: Re: [Q] Tapping into existing objects
  • Next by Date: Re: NSView -subviews ordering?
  • Previous by thread: Re: NSView -subviews ordering?
  • Next by thread: Re: NSView -subviews ordering?
  • Index(es):
    • Date
    • Thread