I have a little problem with a delegate property.
The property “shifts” is a NSMutableArray of objects, initialized and populated by AppDelegate.
@interface isaavAppDelegate : UIResponder <UIApplicationDelegate> {
NSMutableArray *shifts;
}
@property (nonatomic, retain) NSMutableArray *shifts;
In a tableview controller, I try to use the data in the array like this:
I declare a new NSMutableArray changePersons:
NSMutableArray *changePersons;
Then in the viewdidload method:
appDelegate = (isaavAppDelegate *)[[UIApplication sharedApplication] delegate];
changePersons = appDelegate.shifts;
So I use a NSPredicate to filter the data in the array, but when the changePersons array changes, also appDelegate.shifts changes and I don’t understand why…
I tried to copy the array like this:
changePersons = [appDelegate.shifts];
But when I try to apply the filter with NSPredicate, the App crashes and I get an invalid selector.
Anyone can help me?
Thanks, Marco
Try