我嘗試使用下面的代碼來檢查NSDataDictionary的內容:應用程序崩潰
NSDictionary *dataDictionary = [data objectAtIndex:num];
NSString *loaddata = [dataDictionary valueForKey:@"data"];
if ([loaddata hasSuffix: @".mp3"]) {
//code
}
該應用程序崩潰只是每次和我不知道爲什麼......
這是錯誤堆棧:
#0 0x0137d930 in search_method_list
#1 0x01380a99 in _class_getMethodNoSuper_nolock
#2 0x013796ee in lookUpMethod
#3 0x0137981a in _class_lookupMethodAndLoadCache
#4 0x01387aa3 in objc_msgSend
#5 0x003417fa in -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:withIndexPath:]
#6 0x0033777f in -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:]
#7 0x0034c450 in -[UITableView(_UITableViewPrivate) _updateVisibleCellsNow:]
#8 0x00344538 in -[UITableView layoutSubviews]
#9 0x00e19451 in -[CALayer layoutSublayers]
#10 0x00e1917c in CALayerLayoutIfNeeded
#11 0x00e1237c in CA::Context::commit_transaction
#12 0x00e120d0 in CA::Transaction::commit
#13 0x00e427d5 in CA::Transaction::observer_callback
#14 0x01206fbb in __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__
#15 0x0119c0e7 in __CFRunLoopDoObservers
#16 0x01164bd7 in __CFRunLoopRun
#17 0x01164240 in CFRunLoopRunSpecific
#18 0x01164161 in CFRunLoopRunInMode
#19 0x01b5a268 in GSEventRunModal
#20 0x01b5a32d in GSEventRun
#21 0x002dc42e in UIApplicationMain
#22 0x000021e4 in main at main.m:14
這次事故是在別的地方。 – Max 2011-03-14 12:00:40
如果你想得到迴應,請接受一些答案 – visakh7 2011-03-14 12:05:22
也許你的意思是'[dataDictionary objectForKey:@「data」]'? – 2011-03-14 13:22:25