class Hello { |
private: |
id _greeting_text; // NSStringを保持 |
public: |
Hello() { |
_greeting_text = @"Hello, world!"; |
} |
Hello(const char* greeting_text) { |
_greeting_text = [NSString stringWithUTF8String:greeting_text]; |
} |
void say_hello() { |
printf("%s\n", [_greeting_text UTF8String]); |
} |
}; |
@interface Greeting :NSObject { |
@private |
Hello *_hello; |
} |
- (id)init; |
- (void)dealloc; |
- (void)sayGreeting; |
- (void)sayGreeting:(Hello*)greeting; |
@end |
0 件のコメント:
コメントを投稿