Comments (5)
我在项目中没有这个问题 是不是你数目row item 判断问题 ,还有请给出奔溃信息
from dopdropdownmenu-enhanced.
我测试的数据是
// 数据
self.classifys = @[@"美食",@"今日新单",@"电影",@"酒店"];
self.cates = @[@"自助餐",@"快餐",@"火锅",@"日韩料理",@"西餐",@"烧烤小吃"];
self.movices = @[@"内地剧",@"港台剧",@"英美剧"];
self.hostels = @[@"经济酒店",@"商务酒店",@"连锁酒店",@"度假酒店",@"公寓酒店"];
self.areas = @[@"全城",@"芙蓉区",@"雨花区"];
self.areas1 = @[@"全城",@"芙蓉区",@"雨花区"];
self.sorts = @[@"默认排序",@"离我最近",@"好评优先",@"人气优先",@"最新发布"];
下面是修改测试的两个方法
- (NSInteger)menu:(DOPDropDownMenu *)menu numberOfItemsInRow:(NSInteger)row column:(NSInteger)column
{
if (column == 0) {
if (row == 0) {
return self.cates.count;
} else if (row == 2){
return self.movices.count;
} else if (row == 3){
return self.hostels.count;
}
}else if(column == 1){
return 3;
}
return 0;
} - (NSString *)menu:(DOPDropDownMenu *)menu titleForItemsInRowAtIndexPath:(DOPIndexPath *)indexPath
{
if (indexPath.column == 0) {
if (indexPath.row == 0) {
return self.cates[indexPath.item];
} else if (indexPath.row == 2){
return self.movices[indexPath.item];
} else if (indexPath.row == 3){
return self.hostels[indexPath.item];
}
}else if(indexPath.column == 1){
return self.areas1[indexPath.item];
}
return nil;
}
下面是错误信息
2015-05-29 12:30:47.085 DOPdemo[17322:8397163] *** Terminating app due to uncaught exception 'NSRangeException', reason: '-[UITableView _contentOffsetForScrollingToRowAtIndexPath:atScrollPosition:]: row (3) beyond bounds (3) for section (0).'
*** First throw call stack:
(
0 CoreFoundation 0x0000000109296c65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000108f2fbb7 objc_exception_throw + 45
2 CoreFoundation 0x0000000109296b9d +[NSException raise:format:] + 205
3 UIKit 0x0000000109c337aa -[UITableView _contentOffsetForScrollingToRowAtIndexPath:atScrollPosition:] + 1178
4 UIKit 0x0000000109c34378 -[UITableView scrollToRowAtIndexPath:atScrollPosition:animated:] + 33
5 UIKit 0x0000000109c35d6a -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] + 1198
6 DOPdemo 0x00000001089ed514 -[DOPDropDownMenu tableView:cellForRowAtIndexPath:] + 3508
7 UIKit 0x0000000109c45a28 -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 508
8 UIKit 0x0000000109c24248 -[UITableView _updateVisibleCellsNow:isRecursive:] + 2853
9 UIKit 0x0000000109c3a8a9 -[UITableView layoutSubviews] + 210
10 UIKit 0x0000000109bc4a2b -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 536
11 QuartzCore 0x00000001099c7ec2 -[CALayer layoutSublayers] + 146
12 QuartzCore 0x00000001099bc6d6 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
13 QuartzCore 0x00000001099bc546 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
14 QuartzCore 0x0000000109928886 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 242
15 QuartzCore 0x0000000109929a3a _ZN2CA11Transaction6commitEv + 462
16 UIKit 0x0000000109b41626 _UIApplicationHandleEventQueue + 2140
17 CoreFoundation 0x00000001091ca431 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17
18 CoreFoundation 0x00000001091c02fd __CFRunLoopDoSources0 + 269
19 CoreFoundation 0x00000001091bf934 __CFRunLoopRun + 868
20 CoreFoundation 0x00000001091bf366 CFRunLoopRunSpecific + 470
21 GraphicsServices 0x000000010d483a3e GSEventRunModal + 161
22 UIKit 0x0000000109b44900 UIApplicationMain + 1282
23 DOPdemo 0x00000001089ef33f main + 111
24 libdyld.dylib 0x000000010bd03145 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
from dopdropdownmenu-enhanced.
谢谢 我已找到问题 晚上fix
from dopdropdownmenu-enhanced.
非常感谢,期待 fix
from dopdropdownmenu-enhanced.
fixed
from dopdropdownmenu-enhanced.
Related Issues (20)
- DN 你好 这个三方只能第一列能两级列表吗 能不能同时2个或者三个展开都是两级列表,我现在发现好像会崩溃
- 兼容性不是很好
- 请提供一个外部方法 HOT 4
- 请问一下,这个三角指示器的颜色问题
- Menu设置textColor颜色不改变,选中了之后才会改变颜色
- 希望有tableview的headerview兼容性的功能。
- 怎么那么久都不见发布新版本 HOT 3
- 放在 header 里 无效 HOT 1
- 关于默认选中第一行
- 能否返回每一列的下标,现在返回的只是点击那一列的数据
- 还能提PR吗?我打算增加菜单打开和收起的delegate方法 HOT 2
- indexpath有问题 HOT 3
- menu.indicatorAnimates 设置无效 HOT 1
- 标题文字过长会错位
- 超出父视图无效 设置了hittest也不行
- 顶部的列数的标题怎么样不显示列数数组数据的第一个,而是我自己指定的顶部标题???
- 顶部的列数的标题怎么样和列数数组数据的文字对其???? HOT 1
- 我该如何获取两个列表中的结果,同时拿着两个结果去查询
- 想找一个有维护的全面的筛选菜单控件的看这里 HOT 3
- 选中后怎么改变显示?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dopdropdownmenu-enhanced.