클래스 picViewController에서 function loadPage를 실행하기 위해 scrollViewController 에서 imageCliked 함수를 호출하지만 작동하지 않습니다. 컴파일러 오류 :함수 호출 문제 (iphone)
"Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** +[scrollViewController loadpage:]: unrecognized selector sent to class 0x17198'"
누구를 도울 수 있는가?
@interface scrollViewController : UIViewController <UIScrollViewDelegate> {
}
- (void)loadPage:(int)page; // loads a new picViewController
+(void) imageCliked;
@end
#import "scrollViewController.h"
#import "picViewController.h"
#import "MLUtils.h"
@implementation scrollViewController
- (void)loadPage:(int)page {
// I need to call this function from +(void) imageCliked
}
/* this function is called by picViewController pressButton1 */
+(void) imageCliked {
NSLog(@"left");
[self loadPage:3];// does not work
}
@end
#import "picViewController.h"
#import "scrollViewController.h"
@implementation picViewController
- (void) pressButton1:(id)sender{
[scrollViewController imageCliked];
}
@end