Weird Apple Sample code
Weird Apple Sample code
- Subject: Weird Apple Sample code
- From: Ruotger Skupin <email@hidden>
- Date: Thu, 13 Dec 2007 13:38:50 +0100
Hi,
I stumpled over weird Apple sample code. It is in the CocoaHTTPServer
example project (file: HTTPServer.m:7) of an Xcode 3 installation. Can
someone give an explanation what this is doing?
@implementation HTTPServer
- (id)init {
connClass = [HTTPConnection self];
return self;
}
....
Obviously not returning the class you ask for is evil IMHO , but I
could live with it if I understood the rest of that method. There's
more (line 56):
@implementation HTTPConnection
- (id)init {
[self dealloc];
return nil;
}
....
The sample code doesn't seem to work anyway, so maybe someone just
committed a broken edit to the repository?
Another question is: Should Apple really publish example code that
looks like this?
Roddi
_______________________________________________
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