Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: compiler warning for not fully implementing protocol




On Jul 31, 2008, at 4:14 PM, Mark Sanvitale wrote:

I think I am doing exactly what you say is necessary (i.e. declare the second method in the superclass's public interface).

Here are some code snippets:

Turning your code snippets into a test program, I can't reproduce that compiler warning, or in a trivial test where the superclass declares/ implements copyWithZone: and the subclass declares conformance. If this works for you, what did I miss?



// File test.m, compile & run with `cc test.m -framework Foundation -o test && ./test`
#import <Foundation/Foundation.h>


@protocol PortalTabProtocol
- (void)refreshDisplay:(id)capture because:(int)trigger;
@end

@interface PortalTabView : NSObject <PortalTabProtocol>
- (NSString *)tabName;
- (void)refreshDisplay:(id)capture because:(int)trigger;
- (id)displayCapture;
@end

@protocol ReadArchiveClient
- (id)displayCapture;
- (void)processedArchive:(id)archive;
@end

@interface PortalActionView : PortalTabView <ReadArchiveClient>
@end

@implementation PortalTabView

- (NSString *)tabName; { return nil; }
- (void)refreshDisplay:(id)capture because:(int)trigger; {}
- (id)displayCapture; { return nil; }

@end

@implementation PortalActionView

- (void)processedArchive:(id)archive {}

@end

int main (int argc, char const *argv[])
{
    NSAutoreleasePool *pool = [NSAutoreleasePool new];

    id obj = [[PortalActionView alloc] init];
    if ([obj conformsToProtocol:@protocol(ReadArchiveClient)])
        NSLog(@"PortalActionView conforms");
    else
        NSLog(@"PortalActionView does not conform");

    [pool release];
    return 0;
}

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden

References: 
 >compiler warning for not fully implementing protocol (From: Mark Sanvitale <email@hidden>)
 >Re: compiler warning for not fully implementing protocol (From: Bill Bumgarner <email@hidden>)
 >Re: compiler warning for not fully implementing protocol (From: Mark Sanvitale <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.