Possible Duplicate:
KVO and NSMutableArray
Like the title says, I need to be able to detect a change in a mutable array. The reason for this would be to automatically refresh my mapview for an app I’m making as soon as the user adds a new location.
I imagine it would be something like asking if the array is equal to the array’s count plus one or the array’s count minus one but I don’t know how to implement that.
If you need more information before answering please don’t hesitate to ask in the comments.
You can use Key-Value Observing for this. For more details check Introduction to Key-Value Observing Programming Guide.
Check this blog about KVO on how to use it. Also check this tutorial. Check this question as well, Key-Value-Observing a to-many relationship in Cocoa