2011-02-09 18 views
0

こんにちは、私はit.Itをスクロールすると、それはうまく動作するtableviewを持っているアプリケーションを作ったテーブルの腐敗200のデータそれは10から20をスクロールしますが、それは大きなデータを示していますが、それはそれからfalls.Can Uなぜ私は問題を見つける必要がありますか? おかげObjective-Cプログラムのスクロールに落ちるUITableView

エラーメッセージ:[NSCFString appendString:]:で

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

アプリケーションがクラッシュしますが、その時点function.In、あなたが取得しているnilをappendstring使用しているあなたのコード、を経るnil.Justしたがって、アプリケーションがクラッシュしています。あなたのコードをデバッグすることもできます。私はあなたが解決策を得ることを願っています。

2

-configureCell:atIndexPath:メソッドでは、-appendString:メソッドをどこかで使用します。関数に渡された引数がnilであれば失敗します。それを修正して、あなたは大丈夫です。

1

はい、私はこのような何かの前にいくつかのテストを使う必要があります。 databsetableでcollumnが空になったとき、それはNILを返していない起こる@「」私は答え

ため

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

感謝を期待していたとして、

関連する問題