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