iphone instance / class method issue
- by user290031
Hey All,
Okay, so I have a viewController method that has some elements created with interface builder and some I coded myself.
I created a view in the IB...lets call it viewOne. I created a loop that creates buttons (through code) and places them on a separate view (viewTwo). This is done in a class method. However, I want the view I made to be opened everytime one of the buttons is clicked. So I did:
[button addTarget:self action:@selector(woogoo:)
forControlEvents:UIControlEventTouchUpInside];
The woogoo class does the following:
+(void) woogoo:(id)sender { //back button
[self.view addSubview:viewOne]
}
However, the program crashes when a button is clicked. I did try making woogoo an instance method but it also crashes in this case too. All I want to do is show viewOne when a button is clicked. Any ideas what I can do?