Related questions
Constants in Objective-C
I'm developing a Cocoa application, and I'm using constant NSStrings as ways to store key names for my preferences.
I understand this is a good idea because it allows easy changing of keys if necessary.
Plus, it's the whole 'separate …
Remove all whitespaces from NSString
I've been trying to get rid of the white spaces in an NSString, but none of the methods I've tried worked.
I have "this is a test" and I want to get "thisisatest".
I've used whitespaceCharacterSet, which is supposed to …
Understanding NSString comparison
Both the following comparisons evaluate to true:
1)
@"foo" == @"foo";
2)
NSString *myString1 = @"foo";
NSString *myString2 = @"foo";
myString1 == myString2;
However, there are definitely times where two NSStrings cannot be compared using the equality operator, and [myString1 isEqualToString:myString2] is required instead. Can …