私はこれを理解していませんが、アプリを起動しようとすると常にエラーが発生します。誰かが私を助けることができますか?おそらくTableeViewController.mの何かになると思います。しかし、よくわかりません。ありがとう
TableCell.h
#import < Parse/Parse.h >
@interface TableCell : PFTableViewCell
@property (strong, nonatomic) IBOutlet UILabel *cellTitle;
@property (strong, nonatomic) IBOutlet UILabel *cellDescript;
@end
TableCell.m
#import "TableCell.h"
@implementation TableCell
@synthesize cellTitle;
@synthesize cellDescript;
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
// Initialization code
}
return self;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
// Drawing code
}
*/
@end
TableeView.h
#import <Parse/Parse.h>
#import "TableCell.h"
#import "DetailViewController.h"
@interface TableeViewController : PFQueryTableViewController {
NSArray *colorsArray;
}
@property (strong, nonatomic) IBOutlet UITableView *colorsTable;
@end
TableeViewController.m
#import "TableeViewController.h"
#import "TableCell.h"
#import "DetailViewController.h"
@interface TableeViewController ()
@end
@implementation TableeViewController @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)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
}
return self; }
- (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; }
- (void)viewDidLoad {
[super viewDidLoad];
[self performSelector:@selector(retrieveFromParse)];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath object:(PFObject
*)object {
TableCell *cell = (TableCell * )[self.tableView dequeueReusableCellWithIdentifier:@"colorsCell"
forIndexPath:indexPath];
NSString * cellTitle = [object objectForKey:@"cellTitle"];
NSString * cellDescript = [object objectForKey:@"cellDescript"];
cell.cellTitle.text = cellTitle;
cell.cellDescript.text = cellDescript;
return cell; }
@end