In + method you can't use self
for that puspose, because self
in class method returns Class
and not the instance.
replace
[button addTarget:self action:@selector(edit) forControlEvents:UIControlEventTouchUpInside];
with
[button addTarget:sharedMyManager action:@selector(edit) forControlEvents:UIControlEventTouchUpInside];
Of course , if your sharedMyManager is static field. And make sure that your sharedMyManager was already initialized before calling that method.