GithubHelp home page GithubHelp logo

Comments (5)

12207480 avatar 12207480 commented on May 30, 2024

我在项目中没有这个问题 是不是你数目row item 判断问题 ,还有请给出奔溃信息

from dopdropdownmenu-enhanced.

czzhengkw avatar czzhengkw commented on May 30, 2024

我测试的数据是
// 数据
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.

12207480 avatar 12207480 commented on May 30, 2024

谢谢 我已找到问题 晚上fix

from dopdropdownmenu-enhanced.

czzhengkw avatar czzhengkw commented on May 30, 2024

非常感谢,期待 fix

from dopdropdownmenu-enhanced.

12207480 avatar 12207480 commented on May 30, 2024

fixed

from dopdropdownmenu-enhanced.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.