iOS: Assertion failure on picker view
Q:
I'm getting an assertion failure while scrolling a picker view w/ zero data(zero rows). While scrolling the picker view I'm getting this crash. Testing on iOS 6
* Assertion failure in -[UITableViewRowData rectForRow:inSection:], /SourceCache/UIKit_Sim/UIKit-2372/UITableViewRowData.m:1630
* Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'request for rect at invalid index path ( 2 indexes [0, 0])'
A:
I've the same problem
I don't know reason why it is happen,
but it can be fixed in ios6 (how it works in ios5 I didn't check):
- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component
{
if ([self getCount] == )
return ;
return [self getCount];
} - (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent: (NSInteger)component reusingView:(UIView *)view {
if ([self getCount] == )
return nil;
}
iOS: Assertion failure on picker view的更多相关文章
- iOS Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3512.30.14/UITableView.m:7962
Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:], /BuildRoot/Library/Cac ...
- iOS Assertion failure in -[UITableView _classicHeightForRowAtIndexPath:]
Assertion failure in -[UITableView _classicHeightForRowAtIndexPath:], /SourceCache/UIKit_Sim/UIKit-3 ...
- iOS开发UI篇—使用picker View控件完成一个简单的选餐应用
iOS开发UI篇—使用picker View控件完成一个简单的选餐应用 一.实现效果 说明:点击随机按钮,能够自动选取,下方数据自动刷新. 二.实现思路 1.picker view的有默认高度为162 ...
- iOS—使用picker View
iOS—使用picker View 一.实现效果 说明:点击随机按钮,能够自动选取,下方数据自动刷新. 二.实现思路 1.picker view的有默认高度为162,不可修改. 2.显示数据,需要设置 ...
- ios AFNetworking 3.0 报错 : *** Assertion failure in -[AFHTTPRequestSerializer requestWithMethod:URLString:parameters:error:],
AFNetWorking[:] *** Assertion failure -- :::] *** Terminating app due to uncaught exception 'NSInter ...
- 【iOS】Assertion failure in -[MASViewConstraint install]
刚遇到了这个问题,详细信息如下: Assertion failure 错误原因: 控件没有添加到视图就使用 mas_makeConstraints 了……应该先把控件添加到视图.
- Assertion failure in -[UISectionRowData refreshWithSection:tableView:tableViewRowData:], /Source
1. *** Assertion failure in -[UISectionRowData refreshWithSection:tableView:tableViewRowData:], /Sou ...
- Assertion failure layoutSublayersOfLayer:], /SourceCache
现象:代码在simulator上能够正常运行但是在真机上出现 Assertion failure in -[UIView layoutSublayersOfLayer:], /SourceCache/ ...
- Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]
今天遇到了Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]这个错误,一直也没有百度,不料想却弄了一个 ...
随机推荐
- ASP.NET Web API 中 特性路由(Attribute Routing) 的重名问题
刚才忘了说了,在控制器名重名的情况下,特性路由是不生效的.不然的话就可以利用特性路由解决同名的问题了. 而且这种不生效是真的不生效,不会提示任何错误,重名或者什么的,直接会报告404,所以也是个坑.
- 自己写的一个操作Mysql的简单的实例
#include <WinSock.h> #include <stdio.h> #include <iostream> #include <windows.h ...
- Linux上添加新硬盘的实例介绍
在Linux上添加新硬盘的实例讲解,有需要的朋友可以看看. 系统:Redhat AS3 UP3硬盘:scsi注意:# 表示是root用户执行的命令 [root@cncmail data1]# fdis ...
- paip.中文 分词 ---paoding 3.1 的使用
paip.中文 分词 ---paoding 3.1 的使用 paoding 3.1 下载: 1 设置字典路径 1 测试代码 1 作者Attilax 艾龙, EMAIL:1466519819@qq. ...
- webpack 利用Code Splitting 分批打包、按需下载
webpack中的解决方案——Code Splitting,简单来说就是按需加载(下载),如果是requireJS对应的AMD的方案中这本是在正常不过了.但是在webpack中All in one的思 ...
- Flink articles
http://ictlabs-summer-school.sics.se/2015/slides/flink-advanced.pdf http://henning.kropponline.de/20 ...
- db papers
http://www.redbook.io/ http://db.cs.berkeley.edu/papers/ https://github.com/rxin/db-readings http:// ...
- Mac OSX系统、Linux、Windows命令行教程
目录 Mac OSX系统.Linux.Windows命令行教程 一.各系统终端的使用方法 二.各系统命令的功能 Mac OSX系统.Linux.Windows命令行教程 用你的终端做一些事情 (com ...
- 详解Base64编码和解码
Base64是最常用的编码之一,比如开发中用于传递参数.现代浏览器中的<img />标签直接通过Base64字符串来渲染图片以及用于邮件中等等.Base64编码在RFC2045中定义,它被 ...
- 更改datatables的分页切换时的'processing'提示信息的式样
jquery.dataTables.css .dataTables_wrapper .dataTables_processing { position: absolute; top: 50%; lef ...