I have declared an array in a header file like this.
NSMutableArray *myArray;
And I have allocated the array in the implementation file loadview method like this.
myArray=[[NSMutableArray alloc]init];
And then i have added some data to it from the sqlite database into the array in the same loadview method. The array retains the content only within the loadview method when i try to access it in other methods it throws an error stating that the array is empty.I tried NSlog within the loadview after loading the array with some data. It works fine within loadview method. Why it s not retaining outside the loadview method ? Can anyone please help me out of this ?
NSString *myStr = [myArray objectAtIndex:0];