2018-07-11

 NSString *a=@"abcd";
 NSString *b=@"abcd";
 NSString *c= [NSString stringWithFormat:@"abcd"];
 NSString *d=@"bcd";
 NSLog(@"%p %p %p ",a,b,c);
 NSLog(@"%d",[a isEqualToString:b]);
 NSLog(@"%d",[a isEqualToString:c]);
 NSLog(@"%d",[a isEqual:b]);
 NSLog(@"%d",a==b);

打印结果

[17901:590443] 0x10c945190 0x10c945190 0xa000000646362614 0x10c9451b0
[17901:590443] 1
[17901:590443] 1
[17901:590443] 1
[17901:590443] 0

你可能感兴趣的:(2018-07-11)