Created
May 14, 2009 02:52
-
-
Save akio0911/111441 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Cocoa/Cocoa.h> | |
@interface Hoge : NSObject { | |
} | |
- (id)init; | |
- (void)dealloc; | |
+ (Hoge*)hoge; | |
@end | |
@implementation Hoge | |
- (id)init | |
{ | |
NSLog(@"Hoge init"); | |
if(self = [super init]){ | |
} | |
return self; | |
} | |
- (void)dealloc | |
{ | |
NSLog(@"Hoge dealloc"); | |
[super dealloc]; | |
} | |
+ (Hoge*)hoge | |
{ | |
Hoge * hoge = [[Hoge alloc] init]; | |
[hoge autorelease]; | |
return hoge; | |
} | |
@end | |
int main(){ | |
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; | |
Hoge * hoge = [Hoge hoge]; | |
[pool release]; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment