编辑:我已经修复了除了两个警告之外,所以谢谢大家的建议和鼓励。我已经离开了两个警告要求我更改数据库:警告是否重要?
/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