Я следовал советам, данным на этом форуме, и все еще испытываю трудности
У меня есть следующее:
#import <UIKit/UIKit.h>
@protocol UIViewForWheelProtocol
- (void) returnImageNumber:(int)imgNum;
@end
#import <UIKit/UIKit.h>
#import "UIViewForWheelProtocol.h";
@interface UIViewForWheel : UIView {
id<UIViewForWheelProtocol> delegate;
}
@property (nonatomic, assign) id<UIViewForWheelProtocol> delegate;
@implementation UIViewForWheel
@synthesize delegate;
-(void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
int num =1 ;
[self.delegate returnImageNumber:num];
}
#import <UIKit/UIKit.h>
#import "UIViewForWheel.h"
#import "UIViewForWheelProtocol.h"
@interface MainMenu : UIViewController <UIViewForWheelProtocol> {
}
-(void) returnImageNumber:(int)whichImage;
@end
#import "MainMenu.h"
@implementation MainMenu
- (void) returnImageNumber:(int)whichImage
{
NSLog(@"HI %i", whichImage);
}
HI 1 не отображается, потому что, несмотря на то, что оно идет к функции touchesMoved, оно не идет к returnImageNumber в классе MainMenu.
Может кто-нибудь объяснить, пожалуйста, что я делаю не так, пожалуйста?