diff --git a/ChangeLog b/ChangeLog index 1a5aaf86c..8f4847e0d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-06-05 18:12-EDT Gregory John Casamento + + * Source/NSDistantObject.m: NSProxy subclasses must override -init + or an exception will be thrown. This change calls the forwarding + mechanism to invoke -init on the remote object. + Patch by David Chisnall + 2009-06-04 Georg Fleischmann * Source/Additions/unicode/nextstep.h: Fixups for encoding mapping. diff --git a/Source/NSDistantObject.m b/Source/NSDistantObject.m index 434b90db8..4fba48581 100644 --- a/Source/NSDistantObject.m +++ b/Source/NSDistantObject.m @@ -443,6 +443,21 @@ enum proxyLocation { return _connection; } +/** + * NSProxy subclasses must override -init or an exception will be thrown. This + * calls the forwarding mechanism to invoke -init on the remote object. + */ +- (id)init +{ + NSMethodSignature *sig = [self methodSignatureForSelector: _cmd]; + NSInvocation *inv = [NSInvocation invocationWithMethodSignature: sig]; + id ret; + [inv setTarget: self]; + [inv setSelector: _cmd]; + [self forwardInvocation: inv]; + [inv getReturnValue: &ret]; + return ret; +} - (void) dealloc {