I want to use exchangeSubviewAtIndex: withSubviewAtIndex: method.
but how can i get the indexes of those views? i already have their pointers, so I thought there might be a method like.
[parentView indexOfSubview:subview];
but I couldn't find that kind of thing in Xcode documents library.
please help me! thank you in advance.
You can find out the index of your object as you find in NSArray, because view.subviews return an array
You can follow this link for more How to get UIView hierarchy index ??? (i.e. the depth in between the other subviews)
You can get array index using this.
And try to catch that index.
Try this code might be helpful to you...
This is how you get it:
[parentView.subviews indexOfObject:subview];