所以我有一个问题。有人可以告诉我这行代码调用(协议)方法的问题吗
[self.delegate poplogin];
poplogin 是方法名称,由于某种原因它不起作用。它没有调用方法poplogin
以供参考 :
@property(nonatomic,retain) id<loginAuthDelegate> delegate;
所以让我解释一下这个案子
所以可以说我有一个类 abc.h
@protocol loginAuthDelegate <NSObject>
-(void)poplogin;
@end
接口后
@property(nonatomic,retain) id<loginAuthDelegate> delegate;
in .m i am just calling the Delegate and @synthesize it
[self.delegate poplogin];
not i have another files
let say def.h
i am importing the Class abc.h
@interface def : UIViewController<loginAuthDelegate>
def.m
-(void)poplogin
{
NSLog(@"Delegate doesn't respond to here");
vmpaSecureLogin *ivc = [[vmpaSecureLogin alloc] init];
ivc.modalPresentationStyle = UIModalPresentationFormSheet;
[self presentModalViewController:ivc animated:YES];
}