Re: valueForKeyPath: not found in protocol
Re: valueForKeyPath: not found in protocol
- Subject: Re: valueForKeyPath: not found in protocol
- From: Mark Wright <email@hidden>
- Date: Tue, 16 Nov 2010 12:23:26 +0000
On 16 Nov 2010, at 11:27:22, Remco Poelstra wrote:
Op 16 nov 2010, om 12:18 heeft Mark Wright het volgende geschreven:
Your AudionetQueueDelegate protocol is probably not inheriting from
<NSObject> (the protocol) so it warns that valueForKeyPath: is not
found. It'll also probably complain about methods like
respondsToSelector: which is also part of the NSObject protocol.
You need to write your protocol declaration in
AudionetQueueDelegateProtocol.h as:
@protocol AudionetQueueDelegate <NSObject>
...
@end
Then it should silence the warnings and no casting is required
(which is not the correct solution in this case I believe).
That does not seem to work.
I now have:
#import <UIKit/UIKit.h>
@protocol AudionetQueueDelegate <NSObject>
@end
But then the warning returns. (Having set the delegate to id
<AudionetQueueDelegate> again).
Kind regards,
Remco Poelstra
Yes, apologies for that, valueForKeyPath: (et al) is not part of the
NSObject protocol.
It's part of the NSKeyValueCodingProtocol which is a category on
NSObject (an 'informal protocol') so maybe Roland's suggestion is the
best here:
NSObject <AudionetQueueDelegate> *delegate;
That also means the NSObject protocol inheritance isn't needed anymore
since it's now typed as an NSObject...
_______________________________________________
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