If you use ARC you may happen to meet this warning message: "PerformSelector may cause a leak because its selector is unknown". In the first half of this article I will give some examples on how to avoid this warning by using some alternate methods, after that I will show other examples for performSelector alternatives on different situations.

If you are having multiple views in your application, and in that case you want to have a variable accessible to every view, you should always create a Model/Data(singleton) class and define the variable in it. Something like this :

//DataClass.h

@interface DataClass:NSObject{

NSMutableArray *arrGlobal;

}

@property(nonatomic,retain) NSMutableArray *arrGlobal;

+(DataClass*)getInstance;

@end

//DataClass.m

@implementation DataClass

@synthesize arrGlobal;

static DataClass *instance =nil;

+(DataClass*)getInstance
{

@synchronized(self){

if(instance==nil){
instance = [DataClass new];}

}

return instance;

}

Now in your view controller you need to call this method as :

DataClass *obj= [DataClass getInstance];
obj.arrGlobal = arrLocal;

This variable will be accessible to every view controller. You just have to create an instance of Data class.