On 3 Oct 2012, at 14:17, Koen van der Drift wrote:
> On Wed, Oct 3, 2012 at 9:03 AM, Koen van der Drift
> wrote:
> Good point, thanks. So are there any workarounds for that? I'm sure
>> this pattern (doing lots of calculations concurrently, and store the
>> results in a common object for later)
On Wed, Oct 3, 2012 at 9:03 AM, Koen van der Drift
wrote:
Good point, thanks. So are there any workarounds for that? I'm sure
> this pattern (doing lots of calculations concurrently, and store the
> results in a common object for later), is used in other situations as
> well.
>From a quick search
On Wed, Oct 3, 2012 at 8:48 AM, Mike Abdullah wrote:
>
Regardless, your posted code is going to blow up sooner or later.
NSMutableArray is not safe to modify from more than a single thread at
a time. If two of your worker blocks happen to finish at the same time
and call -addObject: together, nast
On 3 Oct 2012, at 13:37, Koen van der Drift wrote:
> On Tue, Oct 2, 2012 at 10:30 PM, Koen van der Drift
> wrote:
>
>>> Thanks, I'll Google for some examples. For now, I still get an
>>> EXC_BAD_ACCESS (code=13, address = 0x0) error in one of the threads after
>>> several iterations. Some mo
On Tue, Oct 2, 2012 at 10:30 PM, Koen van der Drift
wrote:
>> Thanks, I'll Google for some examples. For now, I still get an
>> EXC_BAD_ACCESS (code=13, address = 0x0) error in one of the threads after
>> several iterations. Some more digging reveals:*** -[MyObject setPosition:]:
>> message se
On Oct 2, 2012, at 9:21 PM, davel...@mac.com wrote:
> Only variables that are being modified by the block need to be declared with
> the __block specifier. You shouldn't be declaring the underlying instance
> variables as __block. You can mix and match ARC and non-ARC code. Google
> should hel
On Oct 2, 2012, at 8:43 PM, Koen van der Drift
wrote:
>
> On Oct 2, 2012, at 6:19 PM, Koen van der Drift
> wrote:
>
>>
>> On Oct 2, 2012, at 6:07 PM, davel...@mac.com wrote:
>>
>>> I can't speak to the other examples since I haven't seen them, but the
>>> __block specifier is necessary i
On Oct 2, 2012, at 6:19 PM, Koen van der Drift
wrote:
>
> On Oct 2, 2012, at 6:07 PM, davel...@mac.com wrote:
>
>> I can't speak to the other examples since I haven't seen them, but the
>> __block specifier is necessary if your block modifies the variable (your
>> block does modify i). Your
On Oct 2, 2012, at 6:07 PM, davel...@mac.com wrote:
> I can't speak to the other examples since I haven't seen them, but the
> __block specifier is necessary if your block modifies the variable (your
> block does modify i). Your example also seems a bit strange since your for
> loop modifies i
On Oct 2, 2012, at 5:49 PM, Koen van der Drift
wrote:
> Hi,
>
> When looking how to implement an NSOperationQueue with a loop, I found
> several examples that have the following structure:
>
> NSInteger i;
>
>for ( i = 0; i < 1000; i++ ) {
>[queue addOpera
Hi,
When looking how to implement an NSOperationQueue with a loop, I found several
examples that have the following structure:
NSInteger i;
for ( i = 0; i < 1000; i++ ) {
[queue addOperationWithBlock:^{
i += 1;
}];
11 matches
Mail list logo