Something is wrong with this code, because when I click the button, you open UIPickerview . Nothing has happened. Why is this
-(void)pickerview:(id)sender { items =[[NSArray alloc]initWithObjects:@"Hindi",@"English",nil]; pickerView=[[UIPickerView alloc] initWithFrame:CGRectMake(10,100,150,150)]; pickerView.transform = CGAffineTransformMakeScale(0.75f, 0.75f); pickerView.delegate = self; pickerView.dataSource = self; pickerView.showsSelectionIndicator = YES; pickerView.backgroundColor = [UIColor clearColor]; [pickerView selectRow:1 inComponent:0 animated:YES]; } - (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView; { return 1; } - (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component; { return [items count]; } - (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component { return[items objectAtIndex:row]; }
Can someone please tell me what is wrong with this code.
source share