views:

10

answers:

0

Hello people,

i have implemented the following viewDidLoad() Method:

- (void)viewDidLoad {
    [super viewDidLoad];

    // loading images into the queue
    loadImagesOperationQueue = [[NSOperationQueue alloc] init];
    AFOpenFlowView *openFlow = self.view;
    theControl = [[UIControl alloc] initWithFrame:self.view.frame];
    NSString *imageName;
    btn = [UIButton buttonWithType:UIButtonTypeCustom];
    btn.frame = CGRectMake(10, 10, 40, 40);
    [btn addTarget:self action:@selector(testMethode) forControlEvents:UIControlEventTouchUpInside];
    [btn setTitle:@"<<" forState:UIControlStateNormal];
    [btn setHidden:YES];
    [theControl addSubview:btn];

    for (int i=0; i < 10; i++) {
        imageName = [[NSString alloc] initWithFormat:@"cover_%d.jpg", i];
        imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:imageName]];
        UIImage *aktuellesImage = imageView.image;
        UIImage *scaledImage = [aktuellesImage scaleToSize:CGSizeMake(100.0f, 100.0f)];
        [openFlow setImage:scaledImage forIndex:i];
//      [(AFOpenFlowView *)self.view setImage:scaledImage forIndex:i];

        [imageName release];
        [aktuellesImage release];       
    }
    [theControl addSubview:openFlow];
    [theControl setUserInteractionEnabled:YES];

    [(AFOpenFlowView *)self.view setNumberOfImages:10];
}

And the following touchesEnded() Method:

- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
    [btn setHidden:NO];
}

But the touchesEnded doesn't work, and the Button will not shown when i touch the picture, does anybody know what is the Problem???

Greetings Marco