NSInvalidArgumentException這個到底是什么意思,我到網上查了下,每個的錯誤都不同。


我幾乎把所有的東西都注釋了,但還是崩了

 

#import "ViewController.h"

//#import "WeiBo.h"

 

@interface ViewController ()//<UITableViewDataSource,UITableViewDelegate>

 

//@property (nonatomic ,strong) NSArray * statuses;

 

@end

 

@implementation ViewController

 

//-(NSArray *)statuses{

//    

//    if (!_statuses) {

//        _statuses = [WeiBo weiboList];

//    }

//    

//    return _statuses;

//}

 

- (void)viewDidLoad {

    [super viewDidLoad];

    // Do any additional setup after loading the view, typically from a nib.

}

 

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{

//    NSLog(@"%d",self.statuses.count);

    return 10;

    

}

 

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{

    

    static NSString * reuseID = @"weibo";

    UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:reuseID];

    if (!cell) {

        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:reuseID];

    }

    

//    WeiBo * weibo = self.statuses[indexPath.row];

//    cell.imageView.image = [UIImage imageNamed:weibo.icon];

    cell.textLabel.text  = @"11";

    

    return cell;

}

 

 

@end

 

錯誤內容:

2016-02-28 20:52:03.021 weibo[2661:180833] -[UIViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x7af74ed0

2016-02-28 20:52:03.025 weibo[2661:180833] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x7af74ed0'

*** First throw call stack:


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM