Re: Receiver type for instance message is a forward declaration
Re: Receiver type for instance message is a forward declaration
- Subject: Re: Receiver type for instance message is a forward declaration
- From: Carl Hoefs <email@hidden>
- Date: Fri, 06 May 2016 13:42:07 -0700
> On May 6, 2016, at 1:35 PM, John McCall <email@hidden> wrote:
>
>> On May 6, 2016, at 1:32 PM, Carl Hoefs <email@hidden> 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 (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