我用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