views:

422

answers:

1

Hi, in fact the title contains my question. I have a UISegmentedControl, and need to deselect currently selected tab. I tried:

[menu setSelectedSegmentIndex:-1];

menu being the UBOutlet for uisegmentedcontrol but this gives me exception. anyone have some idea? thanks peter

A: 

I would assume that you've called [myArray length] instead of the proper [myArray count] somewhere in your code. NSArray uses the count method, not length for the number of items it contains.

David Kanarek
hi, i don't understand. what does this have to do with uisegmentedcontrol
dusker
Nothing directly, but based on the exception you posted, the problem is not with UISegementedControl. Perhaps somewhere in your handling of changing the selected segment you access an array.
David Kanarek