我正试图在我的项目中实现MWPhotoBrowser。我增加了所有的代表,但仍然不显示照片。
这是我的didSelectRowAtIndexPath:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[self performSegueWithIdentifier:@"MWPhotoBrowserSegue" sender:self]
}这是我的方法:
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([segue identifier] isEqualToString:@"MWPhotoBorwserSegue"])
{
photoBrowser = [[MWPhotoBrowser alloc]initWithDelegate:self];
UINavigationController * nc = [[UINavigationController alloc]initWithRootViewController:photoBrowser];
nc.modalTransitionStyle = UIModalTransitionStyleCrossDisolve;
[photos addObject:[MWPhoto photoWithImage:[UIImage imageNamed:@"picasa.jpg"]];
[photoBrowser setCurrentPhotoIndex:0];
[self.navigationController presentViewController:nc animated:YES completion:nil];
}
}#ofPhotosInBrowser:
-(NSUInteger)numberOfPhotosInPhotoBrowser:(MWPhotoBrowser *)photoBrowser
{
return self.photos.count;
}photoAtIndex:
- (MWPhoto *)photoBrowser:(MWPhotoBrowser *)photoBrowser photoAtIndex:(NSUInteger)index {
if (index < self.photos.count)
return [self.photos objectAtIndex:index];
return nil;
}下面是我在didSelectRowAtIndexPath之后得到的信息:叫做:

解决方案编辑:
MWPhotoBrowser将不会显示照片,除非您将self.title放在initWithStyle:方法中。我还忘了添加viewWillDisappear和viewWillAppear
发布于 2013-12-22 08:57:43
我认为你需要调用它的重新加载数据。检查一下Mwphotobrowser.h是否有正确的方法。
发布于 2015-01-15 05:01:22
尝试此[NSOperationQueue mainQueue addOperationWithBlock:^{ self mainQueue动画:YES mainQueue:nil;}];
https://stackoverflow.com/questions/19802408
复制相似问题