macOS/iOS API解説

iOS , Mac アプリケーション開発のために使われる主要フレームワークの日本語情報です。2010年代に書かれた内容です。今後更新はありません。

目次

NSAutoreleasePool の検索結果:

ARC(Auto Reference Counting)

…c]は不要に ** NSAutoreleasePoolの代わりに @autoreleasepool{}を使う ** alloc、new、copy、mutableCopyで始まるメソッドは所有の参照を返す。 ** __strong デフォルト、強い参照 自分自身で保有すると循環参照になる。(メモリが解放されない) __unsafe_unretained iOS4.3以降5未満で弱い参照。nilを代入しておく。 __weak 弱い参照 iOS5以降 __autoreleasing…

NSAutoreleasePoolクラス

…ndation> >NSAutoreleasePoolapple(OS X)apple(iOS) 解説 ARC(アーク:自動参照カウント)環境では@autoreleasepoolを使います。 @autoreleasepool { // ローカルの自動開放プールのコード } ARCを用いてコンパイルする場合は retain release autorelease retaincount は使えません。 継承 NSObject 準拠 NSObject (NSObject) フレー…

Foundationフレームワーク

…可な属性付き文字列 NSAutoreleasePool 10.0〜 2.0〜 自動開放プール NSBlockOperation 4.0〜 複数のBlockの同時使用 NSBundle 10.0〜 2.0〜 リソースなどの場所をしめす NSCache 4.0〜 キャッシュ NSCachedURLResponse 10.2.7〜 2.0〜 キャッシュされたURL Response NSCalendar 10.0〜 2.0〜 カレンダー NSCalendarDate 10.0〜10…

Foundation

…字列Update! NSAutoreleasePool 10.0〜 2.0〜 自動開放プールUpdate! NSBlockOperation 4.0〜 NSBundle 10.0〜 2.0〜 リソースなどの場所をしめすUpdate! NSCache 4.0〜 キャッシュ NSCachedURLResponse 10.2.7〜 2.0〜 キャッシュされたURL ResponseUpdate! NSCalendar 10.0〜 2.0〜 カレンダーUpdate! NSCalend…

currentThread

…ead currentThread] threadDictionary] description]); } - (void)threadTask { int i; NSAutoreleasePool *pool = [NSAutoreleasePool new]; for (i=1;i<100;i++) { NSLog([NSString stringWithFormat:@"%d",i]); } [pool release]; [NSThread exit]; } @end

detachNewThreadSelector:toTarget:withObject:

…elector(threadTask) toTarget:self withObject:nil]; } - (void)threadTask { int i; NSAutoreleasePool *pool = [NSAutoreleasePool new]; for (i=1;i<2000;i++) { NSLog([NSString stringWithFormat:@"%d",i]); } [pool release]; [NSThread exit]; } @end

exit

…elector(threadTask) toTarget:self withObject:nil]; } - (void)threadTask { int i; NSAutoreleasePool *pool = [NSAutoreleasePool new]; for (i=1;i<2000;i++) { NSLog([NSString stringWithFormat:@"%d",i]); } [pool release]; [NSThread exit]; } @end

isMultiThreaded

…iThreaded]){ NSLog(@"YES"); }else{ NSLog(@"NO"); } } - (void)threadTask { int i; NSAutoreleasePool *pool = [NSAutoreleasePool new]; for (i=1;i<2000;i++) { NSLog([NSString stringWithFormat:@"%d",i]); } [pool release]; [NSThread exit]; } @end

sleepUntilDate:

…Task) toTarget:self withObject:nil]; NSLog(@"!!!"); } - (void)threadTask { int i; NSAutoreleasePool *pool = [NSAutoreleasePool new]; for (i=1;i<100;i++) { NSLog([NSString stringWithFormat:@"%d",i]); } [pool release]; [NSThread exit]; } @end

threadDictionary

…ead currentThread] threadDictionary] description]); } - (void)threadTask { int i; NSAutoreleasePool *pool = [NSAutoreleasePool new]; for (i=1;i<100;i++) { NSLog([NSString stringWithFormat:@"%d",i]); } [pool release]; [NSThread exit]; } @end

NSEnumerateHashTable

NSHashTableからNSHashEnumeratorを返します NSHashEnumerator NSEnumerateHashTable ( NSHashTable * table ); 解説 NSHashTableからNSHashEnumeratorを返します。 返り値 引数 ( NSHashTable * )table フレームワーク Foundation クラス NSEnumerateHashTable Function 使用可能 10.0 参照 NSNextH…

setThreadPriority:

…stringWithFormat:@"%f",[NSThread threadPriority]]); } - (void)threadTask { int i; NSAutoreleasePool *pool = [NSAutoreleasePool new]; for (i=1;i<100;i++) { NSLog([NSString stringWithFormat:@"%d",i]); } [pool release]; [NSThread exit]; } @end

threadPriority

…stringWithFormat:@"%f",[NSThread threadPriority]]); } - (void)threadTask { int i; NSAutoreleasePool *pool = [NSAutoreleasePool new]; for (i=1;i<100;i++) { NSLog([NSString stringWithFormat:@"%d",i]); } [pool release]; [NSThread exit]; } @end

setThreadPriority:

…stringWithFormat:@"%f",[NSThread threadPriority]]); } - (void)threadTask { int i; NSAutoreleasePool *pool = [NSAutoreleasePool new]; for (i=1;i<100;i++) { NSLog([NSString stringWithFormat:@"%d",i]); } [pool release]; [NSThread exit]; } @end

threadPriority

…stringWithFormat:@"%f",[NSThread threadPriority]]); } - (void)threadTask { int i; NSAutoreleasePool *pool = [NSAutoreleasePool new]; for (i=1;i<100;i++) { NSLog([NSString stringWithFormat:@"%d",i]); } [pool release]; [NSThread exit]; } @end

isMainThread

… { int i; NSAutoreleasePool *pool = [NSAutoreleasePool new]; for (i=1;i<20000;i++) { NSLog(@"%@------- %d",(([[NSThread currentThread] isMainThread])?@"main":@"sub"),i); [obj setDoubleValue:(double)i]; } [pool release]; [NSThread exit]; } @…

drain

Index>Foundation>NSAutoreleasePool 解説 返り値 ( void ) 引数 フレームワーク Foundation クラス NSAutoreleasePool 使用可能 10.4 参照 例文

addObject

解説 返り値 引数 フレームワーク Foundation クラス NSAutoreleasePool 使用可能 10.0 iOS2.0 参照 例文 //ありません

autorelease

ARC(自動参照カウンタ)を使ったコンパイルでは使用できません。 解説 返り値 引数 フレームワーク Foundation クラス NSAutoreleasePool 使用可能 10.0 参照 例文 //ありません

retain

Index>Foundation>NSAutoreleasePool ARC(自動参照カウンタ)を使ったコンパイルでは使用できません。 解説 返り値 引数 フレームワーク Foundation クラス NSAutoreleasePool 使用可能 10.0 参照 例文 //ありません

addObject:

…oundation>NSAutoreleasePool オートリリースプールへオブジェクトを追加します -(void)addObject:(id)anObject: 解説 オートリリースプールへオブジェクトを追加します。通常このメソッドを呼び出しません、anObjectに対してautoreleaseを送信するのが一般的です。 返り値 ( void ) なし 引数 ( id )anObject オブジェクト フレームワーク Foundation クラス NSAutoreleas…

release

Index>Foundation>NSAutoreleasePool オートリリースプールを開放します ARC(自動参照カウンタ)を使ったコンパイルでは使用できません。 解説 返り値 引数 フレームワーク Foundation クラス NSAutoreleasePool 使用可能 10.0 参照 例文 //ありません

lock

…oid)action:(id)arg { int i; NSAutoreleasePool *pool = [NSAutoreleasePool new]; [theLock lock];//ロック for (i=1;i<2000;i++) { NSLog([NSString stringWithFormat:@"%@ %d",arg,i]); } [theLock unlock];//ロック解除 [pool release]; [NSThread exit]; } @end

unlock

…oid)action:(id)arg { int i; NSAutoreleasePool *pool = [NSAutoreleasePool new]; [theLock lock];//ロック for (i=1;i<2000;i++) { NSLog([NSString stringWithFormat:@"%@ %d",arg,i]); } [theLock unlock];//ロック解除 [pool release]; [NSThread exit]; } @end

new

…ct Class Methods 使用可能 10.0 参照 例文 NSAutoreleasePool *pool=[NSAutoreleasePool new]; // #import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { id theObj = [NSObject new]; } @end //////// theButton = [NSButtonCell new];