macOS/iOS API解説

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

目次

NSIncrementExtraRefCount

指定したオブジェクトの参照カウントを増やします
void  NSIncrementExtraRefCount ( 
       id   anObject );

解説

指定したオブジェクトの参照カウントを増やします。

返り値

引数

( id )anObject

クラス

NSIncrementExtraRefCount

Function

使用可能

10.0

参照

NSExtraRefCount
NSDecrementExtraRefCountWasZero

例文

#import "MyObject.h"

@implementation MyObject

- (IBAction)myAction:(id)sender
{
NSLog([NSString stringWithFormat:@"%d",NSExtraRefCount(sender)]);
[sender retain];
NSLog([NSString stringWithFormat:@"%d",NSExtraRefCount(sender)]);
NSIncrementExtraRefCount(sender);
NSLog([NSString stringWithFormat:@"%d",NSExtraRefCount(sender)]);
}

@end