Objective-C程序落在滚动UITableView上

时间:2011-02-09 12:30:04

标签: objective-c xcode exception

嗨我做了一个有tableview的应用程序,它工作正常,但现在它开始下降当我滚动它。它总是滚动近5-10%的内容,所以如果我使用它在表白色200数据滚动10- 20但更大的数据显示更大的数据,但随后它下降。可以帮助我为什么?或者我必须找到问题的地方? 感谢

错误消息:

2011-02-09 13:23:13.631 NavTest[2277:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSCFString appendString:]: nil argument'
*** Call stack at first throw:
(
    0   CoreFoundation                      0x00fa0be9 __exceptionPreprocess + 185
    1   libobjc.A.dylib                     0x010f55c2 objc_exception_throw + 47
    2   CoreFoundation                      0x00f59628 +[NSException raise:format:arguments:] + 136
    3   CoreFoundation                      0x00f5959a +[NSException raise:format:] + 58
    4   Foundation                          0x000bf406 mutateError + 156
    5   NavTest                             0x0000c13a -[TretiViewController configureCell:atIndexPath:] + 487
    6   NavTest                             0x0000cb22 -[TretiViewController tableView:cellForRowAtIndexPath:] + 191
    7   UIKit                               0x003467fa -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:withIndexPath:] + 634
    8   UIKit                               0x0033c77f -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:] + 75
    9   UIKit                               0x00351450 -[UITableView(_UITableViewPrivate) _updateVisibleCellsNow:] + 1561
    10  UIKit                               0x00349538 -[UITableView layoutSubviews] + 242
    11  QuartzCore                          0x01e5e451 -[CALayer layoutSublayers] + 181
    12  QuartzCore                          0x01e5e17c CALayerLayoutIfNeeded + 220
    13  QuartzCore                          0x01e5737c _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 310
    14  QuartzCore                          0x01e570d0 _ZN2CA11Transaction6commitEv + 292
    15  QuartzCore                          0x01e877d5 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 99
    16  CoreFoundation                      0x00f81fbb __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 27
    17  CoreFoundation                      0x00f170e7 __CFRunLoopDoObservers + 295
    18  CoreFoundation                      0x00edfbd7 __CFRunLoopRun + 1575
    19  CoreFoundation                      0x00edf240 CFRunLoopRunSpecific + 208
    20  CoreFoundation                      0x00edf161 CFRunLoopRunInMode + 97
    21  GraphicsServices                    0x018d5268 GSEventRunModal + 217
    22  GraphicsServices                    0x018d532d GSEventRun + 115
    23  UIKit                               0x002e142e UIApplicationMain + 1160
    24  NavTest                             0x0000257c main + 102
    25  NavTest                             0x0000250d start + 53
)
terminate called after throwing an instance of 'NSException'

3 个答案:

答案 0 :(得分:3)

应用程序崩溃在[NSCFString appendString:]:nil。只需通过你的代码,你正在使用appendstring函数。在这一点上,你得到nil,因此应用程序崩溃。你也可以调试你的代码,我希望你能得到解决方案。

答案 1 :(得分:2)

-configureCell:atIndexPath:方法中,您可以在某处使用-appendString:方法。如果传递给函数的参数为​​nil,则失败。解决这个问题,你很好。

答案 2 :(得分:1)

是的它在附加时崩溃我必须先使用一些测试才能得到这样的帮助。 它发生在databsetable中的collumn为空时它返回NIL而不是@“”正如我所期待的那样

if([[selectedObject valueForKey:@"SOMEDATABASEENTRY"] description]!=nil){
         [pom appendString:[[selectedObject valueForKey:@"SOMEDATABASEENTRY"] description]];}

感谢您的回答

相关问题