已經1周了,我仍然堅持PFImageView。我重拍了一切。從UITableView更改爲PFQueryTableView,然後嘗試使用UITableViewCell顯示圖像,然後使用PFTableViewCell顯示圖像,並且在每種方法中只顯示標籤。每次當我運行我的應用程序,我得到崩潰(SIGABRT),因爲這行:`PFImageView url顯示解析
轟然線
cell.imagevieww.file= [object objectForKey:@"ImageURL"]; [cell.imagevieww loadInBackground];
誰能幫我解決這個問題呢?非常感謝
TableViewController.h
#import <Parse/Parse.h> #import "Customcell.h" #import "DetailViewController.h" @interface TableeViewController : PFQueryTableViewController { NSArray *colorsArray; } @property (strong, nonatomic) IBOutlet UITableView *colorsTable; @end
TableViewController.m
#import "TableeViewController.h"
#import "TableViewCell.h"
#import "DetailViewController.h"
@interface TableeViewController()
@end
@implementation TableeViewController
@synthesize colorsTable;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (id)initWithCoder:(NSCoder *)aCoder
{
self = [super initWithCoder:aCoder];
if (self) {
// The className to query on
self.parseClassName = @"Hracky1";
// Whether the built-in pull-to-refresh is enabled
self.pullToRefreshEnabled = YES;
// Whether the built-in pagination is enabled
self.paginationEnabled = NO;
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath object:(PFObject
*)object {
static NSString *CellIdentifier = @"colorsCell";
CustomCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
if (cell == nil) {
cell = [[CustomCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
}
cell.imagevieww.file= [object objectForKey:@"ImageURL"];
[cell.imagevieww loadInBackground];
cell.cellTitle.text = [object objectForKey:@"cellTitle"];
cell.cellDescript.text = [object objectForKey:@"cellDescript"];
return cell;
}
@end
Customcell.h
#import <Parse/Parse.h> @interface TableViewCell : PFTableViewCell @property (strong, nonatomic) IBOutlet UILabel *cellTitle; @property (strong, nonatomic) IBOutlet UILabel *cellDescript; @property (strong, nonatomic) IBOutlet UILabel *price; @property (strong, nonatomic) IBOutlet PFImageView *imagevieww; @end
什麼是'ImageURL',你設置?什麼是崩潰?什麼是異常消息和堆棧跟蹤? – Wain
我在我的parse.com上有名爲ImageURL的String類,我想通過url顯示圖像。我正在製作一些玩具清單,並在標題,說明和價格上標註3個標籤,並在單元格的左側顯示圖像,我將在parse.com上鍵入哪個url地址,刷新後它將與標籤顯示相同。我不想保存圖像。我可以給你發送故事板的照片,如果你想檢查,我的意思是這個。崩潰線向上更新。無論如何,如果我不通過ctrl imagevieww屬性與故事板中的PFImageView連接,它不會崩潰。但什麼也沒有顯示 – Milan1111