【发布时间】:2014-01-15 22:18:48
【问题描述】:
已经 1 周了,我仍然卡在 PFImageView 上。我重做了一切。从 UITableView 更改为 PFQueryTableView,然后尝试使用 UITableViewCell 显示图像,然后使用 PFTableViewCell 和在每种方法中只有可以显示的东西是标签。每次运行我的应用程序时,我都会因为这条线而崩溃(SIGABRT):`
崩溃线
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是什么?崩溃是哪条线?异常消息和堆栈跟踪是什么? -
我的 parse.com 上有名为 ImageURL 的 String 类,我想通过 url 显示图像。我正在制作一些玩具列表,并有 3 个标签标题、描述和价格,在单元格的左侧我想显示图像,我将在 parse.com 上输入哪个 url 地址,刷新后它将显示与标签相同。我不想保存图像。我可以给你发故事板的照片,如果你想检查,我是什么意思。崩溃线向上更新。无论如何,如果我不
t connect via ctrl imagevieww property with PFImageView in storyboards, it doesnt 崩溃。但什么也没显示。
标签: ios objective-c imageview parse-platform sigabrt