[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Question about objc category
From: |
forumer |
Subject: |
Question about objc category |
Date: |
Wed, 01 May 2013 11:53:25 +0200 |
User-agent: |
Roundcube Webmail/0.6 |
Hi,
I am reading the GNUstep source code and especially the parts that
concern the loading of a Xib and I am currently looking at the following
code :
//https://github.com/gnustep/gnustep-gui/blob/master/Model/IBClasses.h
@interface NSCustomObject : NSObject
{
NSString *className;
id realObject;
id extension;
}
@end
//https://github.com/gnustep/gnustep-gui/blob/master/Model/IBClasses.m
@implementation NSCustomObject (NibToGModel)
- (id)awakeAfterUsingCoder:(NSCoder*)aDecoder
{
#ifdef DEBUG
NSLog (@"%x awakeAfterUsingCoder NSCustomObject: className = %@,
realObject = %@, "
@"extension = %@", self, className, realObject, extension);
#endif
[objects addObject:self];
return self;
}
What I don't understand is the line [objects addObject:self]; where
does the ivar objects comes from ?
Is it the objects variable from the GSXibKeyedUnarchiver ? In this case
does it mean when you use a category
you have access to the caller's context ?
Thanks
- Question about objc category,
forumer <=