2014-01-07 41 views
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 
+0

如果有人有同樣的問題。我已經修好了。 [點擊這裏] [1] [1]:http://stackoverflow.com/questions/21149468/pfimageview-url-displaying-parse – Milan1111

回答

0

你檢查線路的對象:[tempObject objectForKey:@ 「IMAGEURL」]?

我認爲你可以跟蹤對象的URL來找到一些信息。

+0

我這樣做,我認爲一切都很好,但我仍然得到那個錯誤 – Milan1111