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:]这个错误,一直也没有百度,不料想却弄了一个 ...
随机推荐
- [docker]docker0网络模型探究
docker0网络模型step by step 将docker的ns软链到linux ns $ ln -s /var/run/docker/netns /var/run/netns 查看ns,无 $ ...
- JMeter学习笔记(六)-负载与监听
1. 场景设计 场景设计的原则:忠于用户实际操作,组合用户的各种操作到场景中来. JMeter场景主要通过线程组设置来完成的,对于复杂场景还需要与逻辑控制器配合完成. 2.场景设置 JMeter线程组 ...
- JMeter学习笔记(五)-总结
本周主要学习了JMeter如下几方面内容: (1)Bdboy录制方式: (2)JMeter的代理录制方式: (3)关联,在关联时我们要找到哪些内容是要关联的,这个主要通过分析哪些内容是由服务器返回的, ...
- java多线程实验 滚动字
package com.rgy.Test; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt ...
- ny104 最大和
最大和 时间限制:1000 ms | 内存限制:65535 KB 难度:5 描述 给定一个由整数组成二维矩阵(r*c),现在需要找出它的一个子矩阵,使得这个子矩阵内的所有元素之和最大,并把这个子矩 ...
- Spring Boot干货系列:(一)优雅的入门篇
Spring Boot干货系列:(一)优雅的入门篇 2017-02-26 嘟嘟MD 嘟爷java超神学堂 前言 Spring一直是很火的一个开源框架,在过去的一段时间里,Spring Boot在社 ...
- 基于jQuery商品分类选择提交表单代码
分享一款基于jQuery商品分类选择提交表单代码.这是一款基于jQuery实现的商品信息选择列表表单提交代码. 在线预览 源码下载 实现的代码: <div class="yList ...
- C语言 · 文本加密
算法提高 9-2 文本加密 时间限制:1.0s 内存限制:256.0MB 问题描述 先编写函数EncryptChar,按照下述规则将给定的字符c转化(加密)为新的字符:"A ...
- iOS彩票项目--第四天,新特性界面搭建,UICollectionViewController的初次使用
一.新特性界面搭建的思路: 在AppDelegate加载主窗体的时候进行判断程序版本号,直接进入程序或者进入新特性展示界面 取出当前的版本号,与旧的版本号相比较(旧的版本号在进入程序的时候存起来 =& ...
- FastDFS - 文件服务器学习资料
FastDFS搭建及java整合代码 CentOS 6.5下 FastDFS结合Nginx插件实现图片http访问 图片服务器fastDFS的搭建以及配置 nginx fastdfs 配置后 上传成功 ...