objective c - Pass Button object to method -


i trying write generic method allow me pass following: "x", "y" "object" , have move. have this:

 -(void) changeobjectlocations: (integer_t) xspot: (integer_t) yspot: (id) sender   {    if (![sender iskindofclass:[uibutton class]])    {        uibutton *myobject = (uibutton *)sender;        [uiview animatewithduration:1.5                       animations:^{                         cgrect newframe = myobject.frame;         newframe.origin.x = xspot;         newframe.origin.y = yspot;         myobject.frame = newframe;     }];              }   else if (![sender iskindofclass:[uilabel class]])   {     uilabel *myobject = (uilabel *)sender;     [uiview animatewithduration:1.5  animations:^{                         cgrect newframe = myobject.frame;         newframe.origin.x = xspot;         newframe.origin.y = yspot;         myobject.frame = newframe;     }];     } } 

i want call so:

-(void) orientationblocklandscape {      [self changeobjectlocations: 456 :282 : btn1] ;     [self changeobjectlocations: 391 :227 : lbltitle] ;  } 

although working, on compile following warning:

secondviewcontroller.m:33: warning: 'secondviewcontroller' may not respond '-changeobjectlocations:::'

is there better way can/should passing object? in advance , help.

geo...

based on warning outputted, sounds didn't define changeobjectlocations in header of secondviewcontroller -- or it's not same signature you've implemented.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -