Ошибка UITableView - PullRequest
       1

Ошибка UITableView

0 голосов
/ 04 декабря 2010

ViewController.m

#pragma mark -
#pragma mark Table view data source

// Customize the number of sections in the table view.
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}

// Customize the number of rows in the table view.
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 0;
}

// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    static NSString *CellIdentifier = @"Cell";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
    }

    // Configure the cell.

    return cell;
}

ViewController.h

@interface PSLEViewController : UIViewController <UITableViewDelegate,UITableViewDataSource>
{
    IBOutlet UITableView *highScoreTable;
}

@property(retain,nonatomic) UITableView *highScoreTable;

Error

2010-12-04 02:20:15.541 PSLE[14369:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[PSLEViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x3b13080'
2010-12-04 02:20:15.542 PSLE[14369:207] Stack: (

Ответы [ 3 ]

0 голосов
/ 04 декабря 2010

Можно ли проверить источник данных и делегат UITableView в - (void) viewDidLoad ?Они не должны быть нулевыми после загрузки из кончика.

0 голосов
/ 04 декабря 2010

хай, к вашему сведению, вы правильно разместили tableView?проверьте это

пример highScoreTable = [[UITableView alloc]init];

0 голосов
/ 04 декабря 2010

В этом коде нет ничего плохого. Могут быть и другие основные проблемы, например, XIB. Вы уверены, что highScoreTable подключен?

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...