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的更多相关文章

  1. 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 ...

  2. iOS Assertion failure in -[UITableView _classicHeightForRowAtIndexPath:]

    Assertion failure in -[UITableView _classicHeightForRowAtIndexPath:], /SourceCache/UIKit_Sim/UIKit-3 ...

  3. iOS开发UI篇—使用picker View控件完成一个简单的选餐应用

    iOS开发UI篇—使用picker View控件完成一个简单的选餐应用 一.实现效果 说明:点击随机按钮,能够自动选取,下方数据自动刷新. 二.实现思路 1.picker view的有默认高度为162 ...

  4. iOS—使用picker View

    iOS—使用picker View 一.实现效果 说明:点击随机按钮,能够自动选取,下方数据自动刷新. 二.实现思路 1.picker view的有默认高度为162,不可修改. 2.显示数据,需要设置 ...

  5. ios AFNetworking 3.0 报错 : *** Assertion failure in -[AFHTTPRequestSerializer requestWithMethod:URLString:parameters:error:],

    AFNetWorking[:] *** Assertion failure -- :::] *** Terminating app due to uncaught exception 'NSInter ...

  6. 【iOS】Assertion failure in -[MASViewConstraint install]

    刚遇到了这个问题,详细信息如下: Assertion failure 错误原因: 控件没有添加到视图就使用 mas_makeConstraints 了……应该先把控件添加到视图.

  7. Assertion failure in -[UISectionRowData refreshWithSection:tableView:tableViewRowData:], /Source

    1. *** Assertion failure in -[UISectionRowData refreshWithSection:tableView:tableViewRowData:], /Sou ...

  8. Assertion failure layoutSublayersOfLayer:], /SourceCache

    现象:代码在simulator上能够正常运行但是在真机上出现 Assertion failure in -[UIView layoutSublayersOfLayer:], /SourceCache/ ...

  9. Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]

    今天遇到了Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]这个错误,一直也没有百度,不料想却弄了一个 ...

随机推荐

  1. Android:不让 EditText 在 Activity 中自动弹出键盘

    通过属性 android:windowSoftInputMode 可以做到隐藏键盘的. android:windowSoftInputMode 属性有: stateUnspecified,stateU ...

  2. xilinx 官方技术资料

    http://china.xilinx.com/support/index.html/content/xilinx/zh/supportNav/ip_documentation.html

  3. 强者联盟——Python语言结合Spark框架

    引言:Spark由AMPLab实验室开发,其本质是基于内存的高速迭代框架,"迭代"是机器学习最大的特点,因此很适合做机器学习. 得益于在数据科学中强大的表现,Python语言的粉丝 ...

  4. hdu 5289 Assignment(给一个数组,求有多少个区间,满足区间内的最大值和最小值之差小于k)

    1.区间是一段的,不是断开的哟 2.代码是看着标程写的 3.枚举左端点,二分右端点流程: watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L ...

  5. cocos2d-x Vector 使用心得

    标准库Vector类型使用需要的头文件:#include <vector>Vector:Vector 是一个类模板.不是一种数据类型. Vector<int>是一种数据类型. ...

  6. cocos2d-x解决中文乱码问题的几种办法

    昨天改写cocos2d-x的例程,想在其基础上加上一个计分系统.没有分数实在让人没有玩下去的动力! 我在主场景上加上了一个CCLabelTTF,用于显示分数. 但是意外的发现,当内容含有中文时,CCL ...

  7. ny520 最大素因子 筛选法求素数

    最大素因子时间限制:1000 ms  |  内存限制:65535 KB难度:2 描述 GreyAnts最近正在学习数论中的素数,但是现在他遇到了一个难题:给定一个整数n,要求我们求出n的最大素因子的序 ...

  8. 双系统中ubuntu的安装方法

    双系统中ubuntu的安装方法 注意:给电脑安装双系统时,一定要先装Windows系统,再安装Linux系统! 原因是电脑开机后,要先执行一段bootloader引导程序:再由引导程序启动操作系统.W ...

  9. LeetCode: Substring with Concatenation of All Words 解题报告

    Substring with Concatenation of All Words You are given a string, S, and a list of words, L, that ar ...

  10. CentOS 挂载NTFS

    直接在CentOS上挂载NTFS,报错支持ntfs格式: mount: unknown filesystem type 'ntfs' 原因:无法使用Kernel NTFS Module挂载Window ...