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
#ifdef DEBUG | |
# define LOG(...) NSLog(__VA_ARGS__) | |
# define LOG_METHOD NSLog(@"%s", __func__) | |
#else | |
# define LOG(...) ; | |
# define LOG_METHOD ; | |
#endif |
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
switch (n) { | |
case 0 ... 3: | |
process(n); | |
break; | |
} |
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
aClass* anObject=[[[anArray lastObject] retain] autorelease]; | |
[anArray removeLastObject]; |
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
@interface Class : NSObject | |
{ | |
} | |
@end |
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 Book : NSObject { | |
} | |
- (id)init; | |
- (void)dealloc; | |
@end |
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 Child : NSObject { | |
} | |
- (id)init; | |
- (void)dealloc; | |
@end | |
@implementation Child | |
- (id)init | |
{ |
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> | |
int main(){ | |
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; | |
NSString * string = [NSString stringWithString:@"Hello"]; | |
NSLog(@"%@", string); | |
[pool release]; | |
return 0; | |
} |
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 |
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 <Foundation/Foundation.h> | |
@interface Foo : NSObject | |
@end | |
@implementation Foo | |
- (void)dealloc { | |
NSLog(@"%s called", __func__); | |
[super dealloc]; | |
} |
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 <Foundation/Foundation.h> | |
@interface ReferenceCounter : NSObject { | |
id obj; | |
} | |
- (void)setObj:(id)_obj; | |
@end | |
@implementation ReferenceCounter | |
- (void)setObj:(id)_obj { |