I have a Threaded application, in which there is a NSMutableArray
, which contains the NSManagedObjects
, Now i want my array to be accessed once at a time by any Thread. So how do i synchronize that array, or may be put locking mechanism on it.
Thanks in Advance ...
You could wrap every access to the class with something like the following:
@synchronized(myArray) {
[myArray doSomething];
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With