Skip to content

Instantly share code, notes, and snippets.

@delebedev
Created January 29, 2013 11:05
Show Gist options
  • Save delebedev/4663488 to your computer and use it in GitHub Desktop.
Save delebedev/4663488 to your computer and use it in GitHub Desktop.
alloc for non-NSObject subclass
+ (id)alloc
{
MAObject *obj = calloc(1, class_getInstanceSize(self));
obj->isa = self;
obj->retainCount = 1;
return obj;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment