ios - OR statement in the arguments of method -


i have method this:

-(void)examplesend:(nsstring *)gateway byparams:(nsdictionary *)params{     ... } 

now want change params , input argument, support both nsdictionary , nsarray. how can in objective-c ?

change type id instead of nsdictionary , make sure should check inside method if nsdictionary or nsarray before performing class specific actions on it, otherwise cause crash.

-(void)examplesend:(nsstring *)gateway byparams:(id)params{      if([params iskindofclass:[nsdictionary class]]){      }else{      }     ... } 

Comments

Popular posts from this blog

php - Autoloader issue not returning Class -

javascript - How can I reference jquery library using cgi methods in ruby? -

ruby on rails - Scope conditionals for count? -