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 - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -