macOS/iOS API解説

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

目次

isEqualToAttributedString:

INDEX>Foundation>NSAttributedString

レーシーバの属性付き文字列と、他の属性付き文字列が同じかを返します
-(BOOL)isEqualToAttributedString:(NSAttributedString *)otherString:

解説

レーシーバの属性付き文字列と、他の属性付き文字列(otherString)が同じかを返します。

返り値

( BOOL )

YES/NO

引数

( NSAttributedString * )otherString

他の属性付き文字列

クラス

NSAttributedString

Instance Methods

使用可能

10.0
iOS3.2

参照

例文

#import "MyObject.h"

@implementation MyObject

- (IBAction)myAction:(id)sender
{
NSAttributedString *aString1;
NSAttributedString *aString2;
NSAttributedString *aString3;
aString1 = [[NSAttributedString alloc] initWithString:@"string"];
aString2 = [[NSAttributedString alloc] initWithString:@"string"];  
aString3 = [[NSAttributedString alloc] initWithString:@"strink"];  
if ([aString1 isEqualToAttributedString:aString2]){
    NSLog(@"1 = 2");
    }else{
    NSLog(@"1 <> 2");
};
if ([aString1 isEqualToAttributedString:aString3]){
    NSLog(@"1 = 3");
    }else{
    NSLog(@"1 <> 3");
};

}
@end