2011-08-23 33 views
0

我簡直不明白這一點。我發現的是一些論壇帖子,上面寫着「我不知道如何解決這個問題」。我開始了一個簡單的觀點。然後,我添加了ASIHTTPRequest,使用對php腳本的請求調用與數據庫進行通信。在編譯之前,我必須添加Reachability.h。當我真的試圖運行它時,我所得到的只是模擬器上的一個空白屏幕,而主要的XCode中出現了SIGABRT錯誤。SIGABRT啓動時

這裏是輸出:

GNU gdb 6.3.50-20050815 (Apple version gdb-1518) (Sat Feb 12 02:52:12 UTC 2011) 
Copyright 2004 Free Software Foundation, Inc. 
GDB is free software, covered by the GNU General Public License, and you are 
welcome to change it and/or distribute copies of it under certain conditions. 
Type "show copying" to see the conditions. 
There is absolutely no warranty for GDB. Type "show warranty" for details. 
This GDB was configured as "x86_64-apple-darwin".sharedlibrary apply-load-rules all 
Attaching to process 4930. 
2011-08-22 21:47:15.996 ViewInfo[4930:207] -[ViewInfoViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x4c23b80 
2011-08-22 21:47:15.999 ViewInfo[4930:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[ViewInfoViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x4c23b80' 
*** Call stack at first throw: 
(
    0 CoreFoundation      0x010d05a9 __exceptionPreprocess + 185 
    1 libobjc.A.dylib      0x01224313 objc_exception_throw + 44 
    2 CoreFoundation      0x010d20bb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187 
    3 CoreFoundation      0x01041966 ___forwarding___ + 966 
    4 CoreFoundation      0x01041522 _CF_forwarding_prep_0 + 50 
    5 UIKit        0x007792b7 -[UISectionRowData refreshWithSection:tableView:tableViewRowData:] + 1834 
    6 UIKit        0x00776d88 -[UITableViewRowData numberOfRows] + 108 
    7 UIKit        0x0062a677 -[UITableView noteNumberOfRowsChanged] + 132 
    8 UIKit        0x00637708 -[UITableView reloadData] + 773 
    9 UIKit        0x00634844 -[UITableView layoutSubviews] + 42 
    10 QuartzCore       0x01ed6a5a -[CALayer layoutSublayers] + 181 
    11 QuartzCore       0x01ed8ddc CALayerLayoutIfNeeded + 220 
    12 QuartzCore       0x01e7e0b4 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 310 
    13 QuartzCore       0x01e7f294 _ZN2CA11Transaction6commitEv + 292 
    14 UIKit        0x005be9c9 -[UIApplication _reportAppLaunchFinished] + 39 
    15 UIKit        0x005bee83 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 690 
    16 UIKit        0x005c9617 -[UIApplication handleEvent:withNewEvent:] + 1533 
    17 UIKit        0x005c1abf -[UIApplication sendEvent:] + 71 
    18 UIKit        0x005c6f2e _UIApplicationHandleEvent + 7576 
    19 GraphicsServices     0x0188e992 PurpleEventCallback + 1550 
    20 CoreFoundation      0x010b1944 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52 
    21 CoreFoundation      0x01011cf7 __CFRunLoopDoSource1 + 215 
    22 CoreFoundation      0x0100ef83 __CFRunLoopRun + 979 
    23 CoreFoundation      0x0100e840 CFRunLoopRunSpecific + 208 
    24 CoreFoundation      0x0100e761 CFRunLoopRunInMode + 97 
    25 UIKit        0x005be7d2 -[UIApplication _run] + 623 
    26 UIKit        0x005cac93 UIApplicationMain + 1160 
    27 ViewInfo       0x000020d9 main + 121 
    28 ViewInfo       0x00002055 start + 53 
) 
terminate called after throwing an instance of 'NSException' 
Current language: auto; currently objective-c 
(gdb) 
+0

你能分享你的代碼嗎?特別是涉及你的表視圖的代碼。從外觀看,表視圖不能訪問你的數組,這可能是由於你沒有在頭文件中聲明數組而導致的。 –

回答

1

你確定你複製的右輸出?粘貼的輸出顯示所添加的對象作爲一個UITableViewController的代表,但不執行強制性的方法:

- [ViewInfoViewController的tableView:numberOfRowsInSection:]:

除了,而且缺乏代碼爲了幫助你,唯一我能想到的是你沒有添加the required Frameworks for ASIHTTP,或者你安裝了錯誤的可達性(ASI自帶可達性,在另一個文件夾內,它不同於蘋果的可達性,順便說一下)。

+0

謝謝。 我發現了這個問題。有一個tableView。我已經刪除它。我將它放在用戶界面中進行計劃功能,但當我試圖使用連接時,我忘記了它在那裏。我一次創建一個函數。目前的化身現在按計劃運作。 再次感謝。 – AniJW

0

ViewInfoViewController是幾乎可以肯定不是一個UITableViewController(和不符合<UITableViewDataSource>)。我懷疑這是一個UIViewController。在任何情況下,正如Nyan指出的那樣,ViewInfoViewController並未按照要求執行tableView:numberOfRowsInSection:,或者您已將您的tableview的datasource連接到錯誤的對象,並不意味着連接它ViewInfoViewController