慢慢地,但肯定在iphone上获得这个委托和协议的东西,但我不明白这个错误。无法找到协议声明自定义协议委托iphone
我已经在我的第一个视图控制器中声明了我的协议。
在第二个视图控制器中,我尝试将它添加到顶部,然后将其导入到头文件中,并且找不到它。看到我的代码如下。
// SendSMS
#import <UIKit/UIKit.h>
#import "LoginPage.h"
#import "MessageOptions.h"
@protocol SMSProtocol <NSObject>
-(NSString *)postbackType;
@end
@interface SendSMS : UIViewController <UITextViewDelegate, UITextFieldDelegate> {
id<SMSProtocol> delegate;
MessageOptions *messageOptions;
LoginPage *loginPage;
IBOutlet UITextField *phonenumber;
IBOutlet UITextView *smsBody;
IBOutlet UIScrollView *scrollview;
}
@property (nonatomic, retain) id<SMSProtocol> delegate;
-(IBAction)LoadMessageOptions;
@end
然后我的第二个观点
#import <UIKit/UIKit.h>
#import "SendSMS.h"
@interface ScheduledSMS : UIViewController <SMSProtocol>{
}
-(IBAction)popBack;
@end
什么是错误? – taskinoor
这应该很好...这个代码似乎没有问题 –
我有同样的问题,我只是在导航器中移动文件,错误消失了。 –