Warnings going away if I run build twice

I'm touching up on Objective-C and learning how to use protocols and ran into for me an odd situation.   My code example that I'm seeing my issue in is listed below in three different files.

Take note that I didn't implement the fly method in Jet.m that the protocol calls for.  When I compile the first time I get warnings like this.


Information:Information:Building target 'SimpleFlyer' with configuration 'Debug' for architecture 'i386' using 'Simulator - iOS 5.0' sdk
Information:Information:Build Finished
/Users/henkbl/Documents/AppCodeProjects/SimpleFlyer/SimpleFlyer/Classes/Jet.m
    Warning:Warning:line (11)incomplete implementation
    Warning:Warning:line (11)method in protocol not implemented
/Users/henkbl/Documents/AppCodeProjects/SimpleFlyer/SimpleFlyer/Classes/Flyer.h
    Note:Note:line (13)method declared here
/Users/henkbl/Documents/AppCodeProjects/SimpleFlyer/SimpleFlyer/Classes/Jet.h
    Note:Note:line (11)required for direct or indirect protocol 'Flyer'


Notice how I get the warnings about not implementing the method the protocol calls for. AppCode also gives me a yellow line under the word Jet at this location @implementation Jet.  Great I can now generate the missing method by hovering over Jet. However if I build again the build warnings go away but the yellow line stays.  My build ouput on the second build attempt looks like this.


Information:Information:Building target 'SimpleFlyer' with configuration 'Debug' for architecture 'i386' using 'Simulator - iOS 5.0' sdk
Information:Information:Build Finished


If I do a clean and then a build the build output will show the warnings again. Now because I'm new I figured it was me not understanding the tools and or language, but in Xcode when I do this the warnings stay after the second build I don't have to do a clean. Any ideas on what I'm not understanding or what is going on?

--File Flyer.h

//
//  Created by Bob on 10/30/11.
//
// To change the template use AppCode | Preferences | File Templates.
//

@protocol Flyer

- (NSString *) crash;
- (NSString *) fly;

@end


--File Jet.h

//
//  Created by Bob on 10/30/11.
//
// To change the template use AppCode | Preferences | File Templates.
//

#import <Foundation/Foundation.h>
#import "Flyer.h"

@interface Jet : NSObject <Flyer>

@end


--File Jet.m

//
//  Created by Bob on 10/30/11.
//
// To change the template use AppCode | Preferences | File Templates.
//

#import "Jet.h"

@implementation Jet

- (NSString*) crash
{
    return @"crashing jet...";
}

@end

0

请先登录再写评论。