无法将图像 url 分配给 iOS 中的 MWPhoto

Unable to assign image url to MWPhoto in iOS

在我的应用程序中使用了 https://github.com/mwaterfall/MWPhotoBrowser 库 .. 但是我无法分配图像 url 我如何分配图像 url。请解决我的问题 请检查我的代码:

 -(NSUInteger)numberOfPhotosInPhotoBrowser:(MWPhotoBrowser *)photoBrowser
{
    return _photos.count;
}

- (MWPhoto *)photoBrowser:(MWPhotoBrowser *)photoBrowser photoAtIndex:(NSUInteger)index
{
    if (index < _photos.count)
        return [_photos objectAtIndex:index];    return nil;
}


- (void)viewDidLoad
{
    [super viewDidLoad];
    NSMutableArray *photos = [[NSMutableArray alloc] init];

   // photos=[[NSMutableArray alloc]initWithObjects:@"1.jpg",@"2.jpg",@"3.png", nil];
    photos=[[NSMutableArray alloc]initWithObjects:@"http://www.google.co.in/imgres?imgurl=https://alaskabibleteacher.files.wordpress.com/2014/09/apple-tree.jpg&imgrefurl=http://brokenbelievers.com/2014/09/19/the-apple-tree/&h=606&w=808&tbnid=uY1OY_HyQ8hE1M:&docid=vKsOHUHBZ2CVFM&ei=1mXuVcu1O8rbuQTW_7Z4&tbm=isch&ved=0CDEQMygBMAFqFQoTCMv4zcvO5scCFcptjgod1r8NDw",@"http://www.apple.com/ipad/home/images/social/og.jpg?201508031746", nil];
    for (int i = 0; i < photos.count; i++)
    {
        [photos addObject:[MWPhoto photoWithURL:[NSURL URLWithString:photos[i]]]];
    }
    _photos = photos;
    MWPhotoBrowser *browser = [[MWPhotoBrowser alloc] initWithDelegate:self];
    UINavigationController *nc = [[UINavigationController alloc]     initWithRootViewController:browser];
    [browser showNextPhotoAnimated:YES];
    [browser showPreviousPhotoAnimated:YES];
    [self presentViewController:nc animated:YES completion:nil];

}

我更新了我的代码和错误... 我收到一个错误: [MWPhoto 长度]:发送到实例 0x7febf97f4740 的无法识别的选择器 2015-09-08 10:43:16.231 沙龙 [3926:66068] *** 由于未捕获的异常 'NSInvalidArgumentException' 而终止应用程序,原因:'-[MWPhoto 长度]:无法识别的选择器发送到实例 0x7febf97f4740'

在您的 Other linker Flags 中添加 -ObjC-all_load 并检查,如果已经可用,则在构建设置中删除上述标志。

额外reference