Have created a UIButton programmatically, all works as expected but how can I use the IB ONLY for positioning the objects on the view?
To be more precise I like to use the IB for this line only (see: setViaIB)
self.searchBtn.frame = CGRectMake(setViaIB, setViaIB, 36, 36);
Full code for UIButton creation:
self.searchBtn = [UIButton buttonWithType:UIButtonTypeCustom];
self.searchBtn.frame = CGRectMake(100, 0, 36, 36);
[self.searchBtn setBackgroundImage:[UIImage imageNamed:@"search.png"] forState:UIControlStateNormal];
[self.searchBtn addTarget:self action:@selector(searchBtnTapped::) forControlEvents:UIControlEventTouchUpInside];
[self.searchBtn setNeedsDisplay];
[self.view addSubview:self.searchBtn];
I’m pretty sure you can’t, why don’t you use
initWithNibName: bundle:to create the whole view in an nib (Interface Builder) file?