Marco
Marco

Reputation: 461

Program doesn't jump in Delegate-Method

Good Morning Community,

I have a problem, because I have implemented an CoverFlowViewController.m with an Delegate method, but the Debugger NEVER jump in this method, does anyone know why? Here is the code:

- (void)viewDidLoad {
    [super viewDidLoad];
    UIButton *weiter = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    weiter.frame = CGRectMake(100, 400, 120, 40);
    [weiter addTarget:self action:@selector(goToChart) forControlEvents:UIControlEventTouchUpInside];
    NSString *ansicht = @"Weiter";
    [weiter setTitle:ansicht forState:UIControlStateNormal];
    [self.view addSubview:weiter];
    // loading images into the queue
    loadImagesOperationQueue = [[NSOperationQueue alloc] init];
    NSString *imageName;
    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)];
        [(AFOpenFlowView *)self.view setImage:scaledImage forIndex:i];
    }
    [(AFOpenFlowView *)self.view setNumberOfImages:10];

}

- (void)openFlowView:(AFOpenFlowView *)openFlowView selectionDidChange:(int)index{
    NSLog(@"%d is selected",index);
}

Does anyone know why the Debugger (= the Programm) never jump into the selectionDidChange() method?

I have no solution since three days, and hope somebody could help me?

Greetings and Thank you beforehand Marco

Upvotes: 0

Views: 354

Answers (2)

surajz
surajz

Reputation: 3611

Add

((AFOpenFlowView *)self.view).viewDelegate = self; on the init or viewDidLoad method

Upvotes: 0

Matthias Bauch
Matthias Bauch

Reputation: 90127

are you sure you connected the viewDelegate to your viewController?
Please add NSLog(@"Delegate: %@", ((AFOpenFlowView*)self.view).viewDelegate); at the end of your viewDidLoad method to see if it is connected.

Upvotes: 1

Related Questions