Created
January 6, 2012 09:48
-
-
Save yas375/1569913 to your computer and use it in GitHub Desktop.
test `isEqual:`, `isEqualToArray:`, `==`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(array1 == array2) => 0 | |
[array1 isEqualToArray:array2] => 1 | |
[array1 isEqual:array2] => 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSString *string1 = @"first string"; | |
NSString *string2 = @"second string"; | |
NSArray *array1 = [NSArray arrayWithObjects:string1, string2, nil]; | |
NSArray *array2 = [NSArray arrayWithObjects:string1, string2, nil]; | |
NSLog(@"(array1 == array2) => %d \n [array1 isEqualToArray:array2] => %d \n [array1 isEqual:array2] => %d", | |
(array1 == array2), | |
[array1 isEqualToArray:array2], | |
[array1 isEqual:array2]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment