Re: Static Functions and Variables
Re: Static Functions and Variables
- Subject: Re: Static Functions and Variables
- From: Jean-Daniel Dupas <email@hidden>
- Date: Sun, 15 Jun 2008 20:01:16 +0200
Le 15 juin 08 à 17:38, Jason Stephenson a écrit :
Whoops! Had a brain fart.
In my previous message where I say @interface, I meant to say
@implemenation. Sorry for any confusion.
Got too much going on today. I should have just stayed away from
email.
--Jason
In Obj-C, the concept of static functions/variables does not exists,
i.e. it's purely a C concept, you can put it wherever you want, it
make no difference.
OK, there is in fact a little difference. If you put a static function
into an implementation block, it's possible to access ivars directy
even if they are declared private.
@interface Foo : NSObject {
@private
NSString *ivar;
}
@end
@implementation Foo
static void MyFunction(Foo *aFoo) {
NSLog(@"%@", aFoo->ivar);
}
@end
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden