`我正在创建一个正在运行的 UIPickerView,但它没有从数组中获取数据,因为没有调用委托方法。我设置了 UIPickerviewdelegate 和数据源,但仍然无法正常工作。不调用委托方法的原因可能是什么??????如果有人知道,请告诉我。提前谢谢。
picker.delegate=self;
picker.dataSource=self;
arrayOfState = [[NSMutableArray alloc] init];
[self.arrayOfState addObject:@"Assam"];
[arrayOfState addObject:@"Andhra Pradesh"];
[arrayOfState addObject:@"Madhya Pradesh"];
[arrayOfState addObject:@"West Bengal"];
[self.arrayOfState addObject:@"Orissa"];
[self.arrayOfState addObject:@"Meghalaya"];
[arrayOfState addObject:@"Tripura"];
[arrayOfState addObject:@"Arunachal Pradesh"];
[arrayOfState addObject:@"Jammu and Kashmir"];
picker=[[UIPickerView alloc] initWithFrame:CGRectMake(0.0f,100.0f,40.0f,120.0f)];
picker.showsSelectionIndicator=YES;