Skip to content

How to set delegate correctly by code (without xib)? #16

Description

@timsims
  1. I create an UIViewController instance in AppDelegate.m

  2. In viewDidLoad of the UIViewController, create an instance of AFOpenFlowView,here is the code

    AFOpenFlowView *af = [[AFOpenFlowView alloc] initWithFrame:CGRectMake(10,20,300,400)];

    NSString *imageName;
    for (int i=0; i < 10; i++) {
    imageName = [[NSString alloc] initWithFormat:@"%d.jpg", i];
    [af setImage:[UIImage imageNamed:imageName] forIndex:i];
    [imageName release];

    }
    [af setNumberOfImages:10];

    [self.view addSubView:af];

That this point , if I run the code, Cover flow work fines except delegate method

And the problem comes, no matter use [af setViewDelegate:self] or [af setViewDelegate:(AFOpenFlowView *)self], my app will crash after switch a Cover

Any idea how should I set the delegate properly?

Thank you guys!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions