发布网友
共2个回答
热心网友
从 iphone 的 照片库中选取的图片,由于 系统不能返回其文件的具体路径,所以这时要用到 ALAssetsLibraryALAssetsLibrary* alLibrary = [[ALAssetsLibrary alloc] init]; __block float fileMB = 0.0; [alLibrary assetForURL:[info objectForKey:UIImagePickerControllerReferenceURL] resultBlock:^(ALAsset *asset) { ALAssetRepresentation *representation = [asset defaultRepresentation]; fileMB = (float)([representation size]/perMBBytes); NSLog(@"size of asset in bytes: %0.2f", fileMB); iHasAsset = 1; [alLibrary release]; } failureBlock:^(NSError *error) { iHasAsset = 2; [alLibrary release]; }];
热心网友
http://blog.csdn.net/shawuer/article/details/74331998