I need to get the UISegmentedControl object that i previously added in the UIBarButtonItem like this
UIBarButtonItem *segmentBarButton=[[UIBarButtonItem alloc] initWithCustomView:segmaentControl];
now i want to get the UISegmentedControl object out of it, how can i do this?
UIBarButtonItemhas a property calledcustomView, which is what you’re looking for: