草庐IT

ios - 解析 PFFile progressBlock :^(int percentDone) { } is not getting called

我正在使用ParseSDK在Back4App服务器上保存一个PFFile,这是代码片段PFFile*videoFile=[PFFilefileWithName:@"video.mp4"data:data];[videoFilesaveInBackgroundWithBlock:^(BOOLsucceeded,NSError*_Nullableerror){if(succeeded){handler(obj,nil);}else{handler(nil,error);}}progressBlock:^(intpercentDone){progress(percentDone);}];但是

ios - 从 Parse 检索 PFFile 的问题

我在parse中创建了一个应用程序,用户在注册时可以选择个人资料图片。这是相关代码。varprofilePictures=PFObject(className:"ProfilePictures")letimageData=UIImagePNGRepresentation(self.profileImage.image)letimageFile=PFFile(name:"image.png",data:imageData)profilePictures["profilePhoto"]=imageFileprofilePictures["user"]=usernameField.textp

swift - 从 Parse 下载 PFFile(图像)将其附加到数组并用该数组填充 UIImageView(Swift)

我在parse和swift方面遇到问题,我希望你能帮助我:)我正在从Parse下载字符串和PFfiles并想将它添加到一个数组中(这工作正常)。然后我想用字符串数组填充一个标签(也可以正常工作)和一个带有PFFile数组的UIImageView,它也是一个图像。但我总是得到一个错误:PFFileisnotconvertibleto"UIImage但我不知道如何转换这个PFFile以便我可以将它与UIImageView一起使用。vartitles=[String]()varfragenImages=[PFFile]()@IBOutletweakvarfragenIm:UIImageVie

ios - 如何使用 swift 将 PFFile 转换为 UIImage?

如何使用swift将PFFile转换为UIImage?在这段代码中,应用程序正在从解析中获取文件,现在我希望它显示在UIImageView上,但是我得到一个错误...这是我的代码...varImageArray:UIImage=[UIImage]()vartextArray:String=[String]()varquery=PFQuery(className:"ClassName")query.findObjectsInBackgroundWithBlock{(objects:[AnyObject]?,error:NSError?)->Voidiniferror==nil{iflet

ios - PFFile 到 PFImageView

我无法在我的iOS应用程序中显示我从Parse获取的图像。我决定使用PFImageView。这是我目前所拥有的:我声明了PFImageView图片:@IBOutletvarpic:PFImageView!在查询中:self.name.text=object["Name"]asStringvarimagefile=object["image"]asPFFileself.pic.file=imagefileself.pic.loadInBackground()self.desc.text=object["Description"]asString这真的很奇怪,因为其他人正在工作(名称和描述

ios - 在上传到 Parse as PFFile 之前如何压缩或减小图像的大小? ( swift )

我试图在直接在手机上拍照后将图像文件上传到Parse。但它抛出一个异常:Terminatingappduetouncaughtexception'NSInvalidArgumentException',reason:'PFFilecannotbelargerthan10485760bytes'这是我的代码:在第一个ViewController中:overridefuncprepareForSegue(segue:UIStoryboardSegue,sender:AnyObject?){if(segue.identifier=="getImage"){varsvc=segue.desti

ios - 在上传到 Parse as PFFile 之前如何压缩或减小图像的大小? ( swift )

我试图在直接在手机上拍照后将图像文件上传到Parse。但它抛出一个异常:Terminatingappduetouncaughtexception'NSInvalidArgumentException',reason:'PFFilecannotbelargerthan10485760bytes'这是我的代码:在第一个ViewController中:overridefuncprepareForSegue(segue:UIStoryboardSegue,sender:AnyObject?){if(segue.identifier=="getImage"){varsvc=segue.desti

ios - 如何在 PFImageView 中显示 PFFile 下载的进度

有谁知道如何为从(Parse.com)下载PFFile的PFImageView设置进度View栏?我找不到任何关于如何这样做的教程。(我不想设置事件指示器,因为我正在加载图像并且我希望用户知道他/她将等待多长时间)。谢谢! 最佳答案 PFImageView方法非常有限,您可以只使用loadInBackground,有或没有完成block。在这些方法中,progressBlock均不可用。解决方法是不将PFFile分配给PFImageView,而是使用使用progressBlock参数的方法加载它。[myImageFilegetDat

ios - 尝试检查 PFFile 是否有数据

我试图在PFFile尝试从背景中拉出图像之前检查它是否有数据。我正在尝试这样做,因为如果您尝试打开其中一个对象并且没有图像,我会不断发生致命崩溃!我的问题是我无法让数据检查工作。PFFile!=nil不起作用,您无法使用if(recipeImageData)检查它是否存在,因为PFFile不符合bool协议(protocol)。任何帮助将不胜感激!这里是变量的声明:varrecipeImageData:PFFile=PFFile()下面是获取数据的函数:overridefuncviewWillAppear(animated:Bool){navItem.title=recipeObjec

ios - 从 Parse 缓存 PFFile 数据

我的应用程序是一个消息传递风格的应用程序,您可以在其中“标记”另一个用户。(有点像推特)。现在,当显示此消息时,属于被标记的人的头像会与该消息一起显示。用户的头像存储为针对PFUser对象的PFFile。我正在加载这样的东西......PFImageView*parseImageView=...[taggedUserfetchIfNeededInBackgroundWithBlock:^(PFObject*user,NSError*error){parseImageView.file=user[@"avatar"];[parseImageViewloadInBackground];}]