Desarrollo de iPad: No se puede encontrar la declaración de protocolo

I have declared a protocol, everything seems to work fine, even Xcode auto-complete the name of the protocol if I try to adopt it, but when I compile the project it keeps telling me "Cannot Find Protocol Declaration". It's strange because is the second protocol I adopt in the same class and I dont have any error with the former! Here is the code:

Here I declare the protocol:

//  LoginViewController.h
#import <UIKit/UIKit.h>

@protocol LoginEndDelegate <NSObject>

 -(void)doneLogin;


@end

And here I try to adopt it:

#import "LoginViewController.h"
#import "WebServiceAPI.h"

@protocol SubstitutableDetailViewController
- (void)showRootPopoverButtonItem:(UIBarButtonItem *)barButtonItem;
- (void)invalidateRootPopoverButtonItem:(UIBarButtonItem *)barButtonItem;
@end


@interface RootViewController : UITableViewController   <UISplitViewControllerDelegate,WebServiceAPIDelegate,LoginEndDelegate> {

Please help me out guys.. Thank you!

preguntado el 08 de noviembre de 11 a las 11:11

1 Respuestas

Try preprocessing the source file that imports your second code snippet and make sure the declaration for LoginEndDate appears before the interface declaration. (the product menu has a "Generate Preprocesssed file" item under "Generate Output" on XCode 4).

Most likely you have an import dependency cycle. LoginViewController.h possibly imports something that causes the interface declaration to be imported ahead of the protocol declaration.

respondido 08 nov., 11:15

the problem was an import dependency cycle. Thanks for help - LuckyStarr

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.