langs a-z

This commit is contained in:
Ingy döt Net 2013-04-10 22:43:41 -07:00
parent db842d013d
commit d066446780
11389 changed files with 98361 additions and 1020 deletions

View file

@ -0,0 +1,53 @@
@interface Camera : NSObject {
}
@end
@implementation Camera
@end
@interface MobilePhone : NSObject {
}
@end
@implementation MobilePhone
@end
@interface CameraPhone : NSObject {
Camera *camera;
MobilePhone *phone;
}
@end
@implementation CameraPhone
-(id)init {
if ((self = [super init])) {
camera = [[Camera alloc] init];
phone = [[MobilePhone alloc] init];
}
return self;
}
-(void)dealloc {
[camera release];
[phone release];
[super dealloc];
}
-(void)forwardInvocation:(NSInvocation *)anInvocation {
SEL aSelector = [anInvocation selector];
if ([camera respondsToSelector:aSelector])
[anInvocation invokeWithTarget:camera];
else if ([phone respondsToSelector:aSelector])
[anInvocation invokeWithTarget:phone];
else
[self doesNotRecognizeSelector:aSelector];
}
-(BOOL)respondsToSelector:(SEL)aSelector {
return [camera respondsToSelector:aSelector]
|| [phone respondsToSelector:aSelector]
|| [super respondsToSelector:aSelector];
}
@end