編輯:我已經修復了除了兩個警告之外,所以謝謝大家的建議和鼓勵。我已經離開了兩個警告要求我更改數據庫:警告是否重要?
/Locations.xcdatamodel:tiles.Map:警告:tiles.Map - 關係不具有逆
/Locations.xcdatamodel: Waypoint.description:警告:Waypoint.description - 屬性名稱與已經在NSObject或NSManagedObject上的方法衝突
我有一個iPhone應用程序在編譯時會拋出超過100個警告,但它是經過時間測試的。
我應該關心警告嗎?
EDIT因爲受訪者問,這裏是我的一些警告:
Warning: Multiple build commands for output file /Users/andrewljohnson/Desktop/thetrailbehind/TrailTracker/build/Debug-iphonesimulator/Gaia Places.app/wrench.png /Locations.xcdatamodel:tiles.Map: warning: tiles.Map -- relationship does not have an inverse /Locations.xcdatamodel:Waypoint.description: warning: Waypoint.description -- property name conflicts with a method already on NSObject or NSManagedObject /TrailTrackerAppDelegate.m:58: warning: passing argument 1 of 'initWithViewController:withTitle:' from distinct Objective-C type /Users/andrewljohnson/Desktop/thetrailbehind/TrailTracker/Classes/TrailTrackerAppDelegate.m: In function '-[TrailTrackerAppDelegate applicationDidFinishLaunching:]': /Users/andrewljohnson/Desktop/thetrailbehind/TrailTracker/Classes/TrailTrackerAppDelegate.m:202: warning: no '-initWithFrame:forHelpScreen:' method found /Users/andrewljohnson/Desktop/thetrailbehind/TrailTracker/Classes/TrailTrackerAppDelegate.m:202: warning: (Messages without a matching method signature /TrailTrackerAppDelegate.m:329: warning: 'gpsController' may not respond to '-setAccuracy:' /Users/andrewljohnson/Desktop/thetrailbehind/TrailTracker/Classes /TrailTrackerAppDelegate.m:411: warning: local declaration of 'tabBarController' hides instance variable /TrailTrackerAppDelegate.m:422: warning: 'TrailTrackerAppDelegate' may not respond to '-getAudioPlayer:' /Users/andrewljohnson/Desktop/thetrailbehind/TrailTracker/Classes/TrailTrackerAppDelegate.m:633: warning: 'Reachability' may not respond to '-isHostReachable:' /Users/andrewljohnson/Desktop/thetrailbehind/TrailTracker/Classes/TrailTrackerMapView.h:18: warning: 'myTopoMapSource' defined but not used warning: 'dbCache' defined but not used /TrailTrackerAppDelegate.m:58: warning: passing argument 1 of 'initWithViewController:withTitle:' from distinct Objective-C type /Users/andrewljohnson/Desktop/thetrailbehind/TrailTracker/Classes /Users/andrewljohnson/Desktop/thetrailbehind/TrailTracker/Classes/TripViewController.m:68: warning: 'TripViewController' may not respond to '-checkForNullImages' /Users/andrewljohnson/Desktop/thetrailbehind/TrailTracker/Classes/TripViewController.m:94: warning: 'TrailTrackerAppDelegate' may not respond to '-blamblamblam' /Users/andrewljohnson/Desktop/thetrailbehind/TrailTracker/Classes/MapViewController.m:406: warning: passing argument 1 of 'initWithData:' from distinct Objective-C type
因此,對我來說是一種折衷。我花費每秒修復警告是第二次我不花費改進應用程序。所以,即使這是最佳實踐,對於擁有如此有限資源的人來說,最好的做法是什麼? – 2009-09-05 00:48:08
有人在其他答案之一的註釋中註釋(http://stackoverflow.com/questions/1382024/do-warnings-matter/1382040#1382040)可以得到的更嚴重警告之一,「X可能不會迴應給Y留言「。你似乎有不止一些,所以我會說你的警告可能是嚴重的。要判斷它們有多重要,你應該閱讀它們並理解它們的含義,以便即使你不需要修復它們,你至少也知道它們爲什麼會發生。 – 2009-09-05 00:54:09
通常,修復警告*是爲了改進應用程序,至少從未來維護者的角度來看。如果代碼在現在簽入時編譯清理警告,那麼在維護期間任何新警告都會大聲突出。 – RBerteig 2009-09-05 00:56:00