How to create buttons that add integers to a Mutable Array?

You can create instance variable of NSMutableArray and two buttons with setting tag value and on clicking the same you can add it to array.like that below:- – (void)viewDidLoad { [super viewDidLoad]; self.mutArr=[NSMutableArray array]; NSUInteger j=0; for(NSUInteger i=0; i<2; i++) { UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; [button addTarget:self action:@selector(buttonClicked:) forControlEvents:UIControlEventTouchUpInside]; [button setTitle:[NSString stringWithFormat:@”%@ %ld”,@”Button”,i+1] forState:UIControlStateNormal]; … Read more

Creata a UIPickerView. Delegate=self [closed]

Couple of problems. You’ve implemented two of the methods with the wrong names: -pickView:didSelectRow:inComponent: should be -pickerView:didSelectRow:inComponent:, and -pickView:titleForRow:forComponent: should be -pickerView:titleForRow:forComponent:. Also, you’re setting the picker view’s delegate, but you aren’t setting its dataSource, so your code that returns the actual items to display isn’t getting called; you need a pickerView1.dataSource = self; as … Read more