Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Call Class Method in background using Objective c

In the below excerpt,

/*A ClassName with instanceMethod and ClassMethod  */

-(void)instanceMethod;

+(void)ClassMethod;

/*To call a instance method in background */

ClassName  class1obj = [ClassName alloc] init];

[class1obj performSelectorInBackground:@selector(instanceMethod) withObject:nil];

Similarly, how to call a ClassMethod in background using performSelectorInBackground?

If possible, please explain! Please guys join hands ..

like image 533
itechnician Avatar asked Nov 28 '12 04:11

itechnician


1 Answers

Just call

[ClassName performSelectorInBackground:@selector(ClassMethod) withObject:nil];

Because Classes are objects themselves, this will work.

like image 162
Oladya Kane Avatar answered Oct 21 '22 10:10

Oladya Kane