有人可以帮助我使用以下代码:
- (IBAction)addCellButton: (UIBarButtonItem *)sender
{
if(!self.imagePopover)
{
AlbumPicker *albumPicker = [self.storyboard instantiateViewControllerWithIdentifier:@"MultipleImagePicker"];
self.imagePopover = [[UIPopoverController alloc] initWithContentViewController:albumPicker];
albumPicker.delegate = self;
NSLog(@"%@", albumPicker.delegate);
[self.imagePopover presentPopoverFromBarButtonItem:sender
permittedArrowDirections:UIPopoverArrowDirectionAny
animated:YES];
self.imagePopover.delegate = self;
}
}
问题是,当我通过打印来检查albumPicker.m 中的委托时,它设置为nil
?我是否正确设置了代表?