码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2016-02-28 21:12:44      阅读:186      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!