0

祝大家早安,

我在以下代码中有一个大问题并且没有解决方案,所以我希望有人可以帮助我:

- (IBAction)goToChart {
    [rootViewController switchViews];
}
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (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];
        [imageName release];
        NSLog(@"%d is the index",i);

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


}

所以你可以在这个 CoverFlowView 中看到 10 张图片,但是我怎么能找到前面的实际图片,以便在另一个视图中使用它?

有人可以帮我吗?

问候马可

4

1 回答 1

0
-(void)openFlowView: (AFOpenFlowView *)openFlowView imageSelected:(int)index
{
    AppDelegate_iPhone *appDelegate = (AppDelegate_iPhone *)[[UIApplication sharedApplication]delegate];

db_detail = (DB_data *)[self.GalleryArray objectAtIndex:index];


    appDelegate.Id = db_detail.Id;
//  NSLog(@"id: value is %d",db_detail.Id);
//  NSLog(@"Name vlaue is: %@",db_detail.Name);
    appDelegate.title = db_detail.Name;


    DetailMovieViewController *ViewController = [[DetailMovieViewController alloc]init];
    [self.navigationController pushViewController:ViewController animated:YES ];
    [ViewController release];

    [db_detail release];
} 
于 2011-05-05T15:04:35.980 回答