読者です 読者をやめる 読者になる 読者になる

Cocoa

@property を使ってみる

はじめの一歩 まずは一番簡単な使い方から. #import <Foundation/NSObjCRuntime.h> #import <Foundation/NSString.h> @interface MyObject : NSObject { NSString* value; } @property(copy, readwrite) NSString* value; @end @implementation MyObject @synthesize value; @end int main() { MyObject* obj = </foundation/nsstring.h></foundation/nsobjcruntime.h>…

Hello, World! by Objective-C + Foundation Framework

Objective-C + Foundation Framework な Hello, World! を作る. GC 使わない場合 #import <Foundation/NSString.h> #import <Foundation/NSAutoreleasePool.h> #import <stdio.h> int main(int argc, char **argv) { NSAutorelesePool* pool = [[NSAutoreleasePool alloc] init]; NSString* str = [[NSString alloc] initWith</stdio.h></foundation/nsautoreleasepool.h></foundation/nsstring.h>…