我的故事板中有一個UIPickerView。含 所述的UIViewController它已經接口聲明設置UIPickerView pickerView:titleForRow:未調用rowforComponent方法
@interface ContactDetail : UIViewController <ABPeoplePickerNavigationControllerDelegate, UIPickerViewDataSource, UIPickerViewDelegate,UIAlertViewDelegate, UITextFieldDelegate>
上視圖負荷,pickerview委託設定
pickerView_RelationshipType.dataSource=self;
pickerView_RelationshipType.delegate = self;
pickerView_RelationshipType.showsSelectionIndicator = YES;
所有UIPickerView數據源和委託方法被觸發除了那些2
pickerView:titleForRow:rowforComponent
and
pickerView:viewForRow:forComponent:reusingView
那些以下被叫,沒問題
- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component
- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView
- (void)pickerView:(UIPickerView *)pickerView didSelectRow: (NSInteger)row inComponent:(NSInteger)component
- (CGFloat)pickerView:(UIPickerView *)pickerView widthForComponent:(NSInteger)component
向iBhavin和JAL致謝。 我已經意識到我的dataSource從coreData返回零。問題解決 – Add080bbA 2014-11-06 12:04:24
如果我的答案幫助你,請將其標記爲已接受。 – JAL 2014-11-06 14:35:54