宽容他人,放过自己。

将图片从沙盒中取出代码

Posted on By anchoriteFili

NSString *picurlPath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject] stringByAppendingPathComponent:user.picurl];
    NSData *data = [[NSData alloc] initWithContentsOfFile:picurlPath];
    UIImage *image = nil;
    if (data != nil) {
        image = [[UIImage alloc] initWithData:data];
    }else {
        NSLog(@"图片为空");
    }
    self.bookV.image = image;