Hi,
Please look at the following situations:
1. Created a mutable array in main thread, can I read its values in a secondary
thread safely, while no other thread is modifying this mutable array?
2. I need to add objects to this mutable array from a secondary thread, and no
other thread is
Nick,
In your secondary you can use dispatch_async or dispatch_sync to schedule a
block of code to execute on the main thread. Below is a simple example:
dispatch_async(dispatch_get_main_queue(), ^{
// put your code to modify mutable array here
});
I hope this helps.
Thanks,
Abdul
On Aug 6, 2013, at 8:39 AM, Nick Rogers roger...@mac.com wrote:
Hi,
Please look at the following situations:
1. Created a mutable array in main thread, can I read its values in a
secondary thread safely, while no other thread is modifying this mutable
array?
Yes, but the second half
On Aug 6, 2013, at 8:39 AM, Nick Rogers roger...@mac.com wrote:
1. Created a mutable array in main thread, can I read its values in a
secondary thread safely, while no other thread is modifying this mutable
array?
Yes. Most non-thread-safe objects don’t care what threads you call them on,
On Aug 6, 2013, at 8:39 AM, Nick Rogers roger...@mac.com wrote:
1. Created a mutable array in main thread, can I read its values in a
secondary thread safely, while no other thread is modifying this mutable
array?
2. I need to add objects to this mutable array from a secondary thread, and