Iqb*_*han 0 iphone objective-c ipod-touch uisegmentedcontrol
我需要像这样UISegmentedControl以前获得我先前添加的对象UIBarButtonItem
UIBarButtonItem *segmentBarButton=[[UIBarButtonItem alloc] initWithCustomView:segmaentControl];
Run Code Online (Sandbox Code Playgroud)
现在我想从中取出UISegmentedControl物体,我该怎么做?
UIBarButtonItem有一个名为的属性customView,这是您要查找的内容:
UISegmentedControl *control = (UISegmentedControl *) [segmentBarButton customView];
Run Code Online (Sandbox Code Playgroud)