Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在一个 xib 文件中有一个选择器视图,在另一个文件中有一个地图视图。用户使用选择器视图选择地图视图,然后单击一个按钮,该按钮将加载地图视图。但是,当我返回到选取器视图 xib 文件时,选取器视图会返回到默认选择。如何让选择器视图自动选择用户之前选择的 mapView?
当你离开 XIB 时存储选择,当你回来时告诉它重新选择。
http://developer.apple.com/iphone/library/documentation/uikit/reference/UIPickerView_Class/Reference/UIPickerView.html#//apple_ref/occ/instm/UIPickerView/selectRow:inComponent:animated: