首页 > 其他 > 详细

NSInvalidArgumentException这个到底是什么意思,我到网上查了下,每个的错误都不同。

时间:2016-02-28 21:12:18      阅读:1225      评论:0      收藏:0      [点我收藏+]

我几乎把所有的东西都注释了,但还是崩了

 

#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:

NSInvalidArgumentException这个到底是什么意思,我到网上查了下,每个的错误都不同。

原文:http://www.cnblogs.com/kongfutiger/p/5225598.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!