Skip to content

Instantly share code, notes, and snippets.

@fcy
Created February 27, 2013 21:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fcy/5051802 to your computer and use it in GitHub Desktop.
Save fcy/5051802 to your computer and use it in GitHub Desktop.
Super ugly code. Discussion: https://alpha.app.net/fcy/post/3286152
@implementation DatabaseConnection
static DatabaseConnection *connection;
+ (DatabaseConnection *)connection;
{
return connection;
}
+ (void)setConnection:(DatabaseConnection *)newConnection;
{
[newConnection retain];
[connection release];
connection = newConnection;
}
// open connection
- (void) open;
{}
// close connection
- (void) close;
{}
- (id)copyWithZone:(NSZone *)zone {
return self;
}
- (id)retain {
return self;
}
- (unsigned)retainCount {
return UINT_MAX;
}
- (void)release {
}
- (id)autorelease {
return self;
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment