0
我堅持通過URL解析PFIMageView。我已經寫了一個問題,稍微移動一下,但該應用程序仍然無法正常工作。我把運行和得到這個錯誤,沒有加載。Parse.com PFImageview URL不起作用
有錯誤的圖像:http://postimg.org/image/jys3hqegt/
前面的問題:Parse.com adding images via URL
@interface TableViewController()
@end @implementation TableViewController
@synthesize colorsTable;
- (void) retrieveFromParse {
PFQuery *retrieveColors = [PFQuery queryWithClassName:@"Hracky1"];
[retrieveColors findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
if (!error) {
colorsArray = [[NSArray alloc] initWithArray:objects];
}
[colorsTable reloadData];
}];
[self.colorsTable reloadData];
[self.refreshControl endRefreshing]; }
- (id)initWithStyle:(UITableViewStyle)style {
self = [super initWithStyle:style];
if (self) {
// Custom initialization
}
return self; }
- (void)viewDidLoad {
[super viewDidLoad];
[self performSelector:@selector(retrieveFromParse)];
UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init];
self.refreshControl = refreshControl;
[refreshControl addTarget:self action:@selector(retrieveFromParse) forControlEvents:UIControlEventValueChanged]; }
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated. }
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
// Return the number of sections.
return 1; }
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
// Return the number of rows in the section.
return colorsArray.count; }
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"colorsCell";
CustomCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
PFObject *tempObject = [colorsArray objectAtIndex:indexPath.row];
[cell.imageview setFile: [tempObject objectForKey:@"ImageURL"]];
[cell.imageview loadInBackground];
cell.cellTitle.text = [tempObject objectForKey:@"cellTitle"];
cell.cellDescript.text = [tempObject objectForKey:@"cellDescript"];
return cell; }
@end
如果有人有同樣的問題。我已經修好了。 [點擊這裏] [1] [1]:http://stackoverflow.com/questions/21149468/pfimageview-url-displaying-parse – Milan1111