编辑:我现在已经修复了除了两个警告之外的所有警告,所以感谢大家的建议和鼓励.我留下的两个警告要求我更改数据库:
/Locations.xcdatamodel:tiles.Map:warning:瓷砖.地图 - 关系没有反转
/Locations.xcdatamodel:Waypoint.description:警告:Waypoint.description - 属性名称与NSObject或NSManagedObject上已有的方法冲突
我有一个iPhone应用程序,当我编译它时会抛出超过100个警告,但它是经过时间考验和坚实的.
我应该关心警告吗?
编辑因为受访者问,这里有一些警告:
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
是.一些警告可能很重要.
最好将编译器的警告级别设置为最高设置,并尝试消除所有警告.
如果无法通过重构代码删除警告,并且已经检查并认为它是安全的,那么许多语言都会使用"pragma"来使警告静音.
大约在2014年更新:打开将所有警告视为错误的编译器选项越来越常见.我亲自这样做.
| 归档时间: |
|
| 查看次数: |
712 次 |
| 最近记录: |