我用pickerview在我的應用程序和.h文件中我寫的代碼如下警告在UIPickerViewDelegate方法結束
@interface tweetViewController : UIViewController<UIPickerViewDataSource,UIPickerViewDelegate> {
NSArray* activities;
NSArray* feelings;
}
@property (nonatomic,retain) NSArray *activities;
@property (nonatomic,retain)NSArray *fellings;
,我已經寫在my.h文件代碼UIPickerviewDatasource如下其中工程細
- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView
{
return 2;
}
- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component
{
if(component==0)
{
return [activities count];
}
else
{
return [feelings count];
}
}
但UIPickerViewDelegate的下面的代碼顯示我在方法的右大括號警告味精
- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component
{
switch (component) {
case 0:
return [activities objectAtIndex:row];
case 1:
return [feelings objectAtIndex:row];
}
}
plz建議我如何解決問題...
可能的重複http://stackoverflow.com/questions/7025309/shows-warning-msg-at-the-end-of-the-uipickerviewdelegate-method – Devang