views:

17

answers:

0

I am dynamically creating buttons in a class that holds all my functions named Functions.h and .m.

So I basically call my function from the class like this passing in a scrollview:

[Functions buildMyCarousel:SCROLLVIEW]

in that function I then call a buildButton function

The problem is when I set the button up like this:

[button addTarget:self action:@selector(buttonClicked:) forControlEvents:UIControlEventTouchUpInside];

it calls the buttonClicked function in my Functions.m file as opposed to my view or parent.

Is there a way I can have a global function like this, what am I doing wrong?