i am using coredata in my application to store and retrieve values.i want to use NSMutableArray but
AppDelegate *appDelegate = [[UIApplication sharedApplication]delegate];
NSManagedObjectContext *context = [appDelegate managedObjectContext];
NSEntityDescription *entityDesc = [NSEntityDescription entityForName:@"NewExpense" inManagedObjectContext:context];
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc]init];
[fetchRequest setEntity:entityDesc];
NSError *error;
//i am getting error in the following line where self.newArray is an NSMutableArray
self.newArray = [[context executeFetchRequest:fetchRequest error:&error]retain];
[fetchRequest release];
it says incompatiable pointer types assigning to nsmutablearray from nsarray.
but if i declare it as just an array a lot of properties while editing the table view,sorting are not working as they need an nsmutablearray.
This is because executeFetch returns an immutable array.
Use:
[NSMutableArray arrayWithArray:...];