I create an array with string names as shown below
NSMutableArray *strings = [[NSMutableArray alloc]init];
[string addObject:@"string1"];
[string addObject:@"string2"];
[string addObject:@"string3"];
[string addObject:@"string4"];
and I create a button. Whenever I click the button the strings are exchanged how can I do this?
EDIT:
Looks like you do not really lack basic knowledge. You can call this method in NSArray after you add your objects:
This method is the simplest way to do your job:
More about sortedArrayUsingSelector: