valueWithRange:
指定したNSRange構造を含むNSValueを作って、返します
+(NSValue *)valueWithRange:(NSRange)range:
解説
指定したNSRange構造を含むNSValueを作って、返します。
返り値
( NSValue * )
バリュー
引数
( NSRange )range
範囲
フレームワーク
Foundation
クラス
NSValue
Class Methods
使用可能
10.0
参照
- rangeValue
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { //Rangeを渡す場合 NSRange aRange = NSMakeRange(1,10); NSValue *theValue3 = [NSValue valueWithRange:aRange]; NSRange bufferRange; [theValue3 getValue:&bufferRange]; NSLog(@"---%u,%u",bufferRange.location,bufferRange.length); NSLog(@"---%u,%u",[theValue3 rangeValue].location,[theValue3 rangeValue].length); } @end