Re: index beyond bounds when using a queue for a for-loop
Re: index beyond bounds when using a queue for a for-loop
- Subject: Re: index beyond bounds when using a queue for a for-loop
- From: Koen van der Drift <email@hidden>
- Date: Mon, 12 Aug 2013 14:23:39 -0400
On Aug 12, 2013, at 2:05 PM, Jens Alfke <email@hidden> wrote:
> NSMutableArray isn’t thread-safe. You’ll need to synchronize/serialize the assignments somehow. You could do something like
>
> {
> id value = [self doCalculation: i];
> @synchronized(myArray) {
> myArray[i] = value;
> }
> }
>
Unfortunately, I'm still getting the same error.
> although there is probably some nicer GCD API to do the same thing.
>
Are you referring to NSOperationQueue?
Thanks,
- Koen.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden