PFImageView for dummies [英] PFImageView for dummies
问题描述
大家好,我正在寻找一周以来的解析。我真的了解最多的东西。如何在tableViews和Cells等上检索字符串,数组,文件......
无处不在(我的意思是无处不在)我可以找到几个tableviews,collectionViews和除了VİEWCONTROLLER之外的其他东西
所以要显示我的理解方式
检索或显示PFImageView我们必须先连接到我们的.h文件
所以这是我的
Hi guys I'm searching since 1 week for parse . I really understand the most things . how to retrieve strings ,arrays ,file on tableViews and Cells etc. ...
Everywhere ( i really mean everywhere ) i could find for several tableviews ,collectionViews and other thing except for VİEWCONTROLLER
so to show how I understood things
Retrieving or showing a PFImageView we have to first connect to our .h file
so this is mine
@property (strong, nonatomic) IBOutlet PFImageView *BuyPetImage;
after转到我们的.m文件并将它们添加到我们的ViewDidLoad方法
after that were going to our .m file and add these to our ViewDidLoad method
PFQuery *query = [PFQuery queryWithClassName:@"Recipe"];
// [query orderByDescending:@"createdAt"];
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
if (!error) {
for (PFObject *object in objects) {
PFFile *file = object[@"imageFile"];
[file getDataInBackgroundWithBlock:^(NSData *data, NSError *error) {
if (!error) {
[BuyPetImage loadInBackground];
BuyPetImage.image = file; //may be this could be the wrong part ?
}} ];} } } ];
所以我的问题是:我没有任何错误但是当我运行它时,它不会显示在我的应用程序中。
So my problem is: I don't have any error but it's not shown in my app when I run it.
推荐答案
您必须重新排列代码。正如文档所述:
You must rearrange your code. As the documentation says:
BuyPetImage.image = file; //set file
[BuyPetImage loadInBackground];//start download
您是否阅读过所用课程的文档: - O
Didnt you read the docs of the classes you use :-O
我已经改变了它但我认为没关系。
同时我改变了文件而不是图像.. 。
BuyPetImage.file = file; //设置文件
[BuyPetImage loadInBackground]
所以我这样做了。但仍然是空白的图片
i得到一个----套接字未连接
2015-08 -02 19:33:19.175 RecipeBook [4991:245248]从S3下载失败。再试一次。响应:(null),错误:错误Domain = NSPOSIXErrorDomain Code = 57操作无法完成。套接字未连接
2015-08-02 19:33:19.176 RecipeBook [4991:245248]错误:下载失败。----错误是什么?
i have changed it but i think it doesn't matter.
meanwhile i changed file instead of image ...
BuyPetImage.file = file; //set file
[BuyPetImage loadInBackground]
so i did this . but still empty picture
i get a ----Socket is not connected"
2015-08-02 19:33:19.175 RecipeBook[4991:245248] Failed download from S3. Going to try again. Response: (null), Error: Error Domain=NSPOSIXErrorDomain Code=57 "The operation couldn’t be completed. Socket is not connected"
2015-08-02 19:33:19.176 RecipeBook[4991:245248] Error: Download failed. ---- error what is this ?
>
这篇关于PFImageView for dummies的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!