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).





On 16 Nov 2010, at 10:35:31, Remco Poelstra wrote:

Hi,

I've somewhat the same problem as a recent thread, but I can't fix it with what was suggested in that thread.
I've to following class:
#import <Foundation/Foundation.h>
#import "AudionetCommand.h"
#import "AudionetQueueDelegateProtocol.h"
@interface AudionetCommandQueue : NSObject {
        id <AudionetQueueDelegate> delegate;
}

@property (nonatomic, assign) id <AudionetQueueDelegate> delegate;
- (void) enqueueCommand:(AudionetCommand *)command;
@end
@implementation AudionetCommandQueue
@synthesize delegate;
- (void) enqueueCommand:(AudionetCommand *)command {
 //Lots of code
if ([[delegate valueForKeyPath:@"audionetDevices.address"] isEqual: []]) {};
}
@end

I get the warning that valueForKeyPath: is not found in the protocols. If I change the instance variable to id <AudionetQueueDelegate,NSKeyValueCoding>, I get the error that the NSKeyValueCoding protocol can not be found. If I also #import <NSKeyValueCodingProtocol.h> than that header file is not found.
How can I fix this?

Kind regards,

Remco Poelstra

_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/blue.buconero%40virgin.net

This email sent to blue.bucon...@virgin.net

_______________________________________________

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

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

Reply via email to