0

If an NSArrayController is bound to an array that is generated using

@synthesize (strong) anArray;

very strange things happen when using the add: or remove: bindings. For example, I end up with a different address for anArray. I am sure this has to do with the strong keyword. Can someone explain to me why this happens?

Carelinkz
  • 936
  • 8
  • 27
  • Please don't use the [tag:arc] tag for questions related to apple's automatic-reference-counting. Instead, use the [tag:automatic-ref-counting] tag. – Richard J. Ross III Jun 28 '12 at 13:46
  • I had no idea, my apologies. Looking at your link I can see why. I do admit I was pleasantly surprised by the number of followers for "arc" :-D – Carelinkz Jun 28 '12 at 20:39

1 Answers1

0

Are you binding the NSArrayController to an NSArray, or an NSMutableArray? NSArrayController with work if you bind it to an NSArray, but because the array is immutable the array controller will create a new array every time you add or remove objects.

Tom Dalling
  • 23,305
  • 6
  • 62
  • 80
  • That makes sense, I will double check asap. But I do think it may be a mutable array, since an `NSArray` just would not make sense in my app! – Carelinkz Jun 30 '12 at 13:40