> On May 6, 2016, at 1:35 PM, John McCall <rjmcc...@apple.com> wrote:
> 
>> On May 6, 2016, at 1:32 PM, Carl Hoefs <newsli...@autonomy.caltech.edu> 
>> wrote:
>> I'm building for iOS 9.3, and am using NSOperationQueue throughout. Once in 
>> a while, NSOperationQueue -addOperation: throws an exception. I guess this 
>> is a well-known bug going all the way back to 2008. I found Mike Ash's 
>> writeup on the issue, and have downloaded his replacement class, 
>> RAOperationQueue. However, it was written long ago for GC not ARC. I have 
>> one remaining problem in converting the code.
>> 
>> - (BOOL)_runOperationFromList: (RAAtomicListRef *)listPtr sourceList: 
>> (RAAtomicListRef *)sourceListPtr
>> {
>>      RAOperation *op = [self _popOperation: listPtr];
>>      if( !op )
>>      {
>>              *listPtr = RAAtomicListSteal( sourceListPtr );
>>              // source lists are in LIFO order, but we want to execute 
>> operations in the order they were enqueued
>>              // so we reverse the list before we do anything with it
>>              RAAtomicListReverse( listPtr );
>>              op = [self _popOperation: listPtr];
>>      }
>>      
>>      if( op )
>>              [op run];  <-- ERROR HERE
>>      
>>      return op != nil;
>> }
>> 
>> The error I'm getting is: Receiver type 'RAOperation' for instance message 
>> is a forward declaration.
>> 
>> What does this error mean, and how can I fix it?
> 
> It means you haven't #included the header with the @interface declaration for 
> RAOperation.
> 
Indeed, that silenced the error, thanks! 
I would have thought that this earlier line would have been flagged if 
RAOperation.h hadn't been included:

        RAOperation *op = [self _popOperation: listPtr];

-Carl


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to