Hi, I am trying to get to grips with programmatically configuring views. I have a UIViewController and want to add a UIButton to its view.
Well, I created the button:
UIButton *newViewButton = [[UIButton alloc] initWithFrame:CGRectMake(baseX + viewPlusX, baseY + viewPlusY, viewWidth, viewHeight)];
[newViewButton setTitle:@"View" forState:UIControlStateNormal];
[newViewButton setTag:(int)key];
[newViewButton addTarget:myViewController action:@selector(viewButton:) forControlEvents:UIControlEventTouchUpInside];
but when trying to add it to the view
[myViewController.view addSubview:newViewButton];
I get the error
error: expected ':' before":" token
any clue what I am doing wrong
regards