iOS开发之地图代理不起作用(提示vImage decode failed, falling back to CG path.)

iOS开发之地图代理不起作用(提示vImage decode failed, falling back to CG path.)

项目中用到了地图相关的东西,就把曾经的demo搬了出来,结果发现直接执行之前的demo没有问题,在xcode5下新建项目再把代码粘贴过来就会提示

May  5 11:36:21 infomedia-iPod-touch TestLocation[1465] <Error>: CGBitmapContextCreate: unsupported parameter combination: 5 integer bits/component; 16 bits/pixel; 3-component color space; kCGImageAlphaNoneSkipLast; 512 bytes/row.
May  5 11:36:21 infomedia-iPod-touch TestLocation[1465] <Error>: CGBitmapContextCreate: unsupported parameter combination: 5 integer bits/component; 16 bits/pixel; 3-component color space; kCGImageAlphaNoneSkipLast; 512 bytes/row.
2014-05-05 11:36:21.974 TestLocation[1465:8b03] vImage decode failed, falling back to CG path.
2014-05-05 11:36:21.969 TestLocation[1465:9003] vImage decode failed, falling back to CG path.
May  5 11:36:22 infomedia-iPod-touch TestLocation[1465] <Error>: CGBitmapContextCreate: unsupported parameter combination: 5 integer bits/component; 16 bits/pixel; 3-component color space; kCGImageAlphaNoneSkipLast; 512 bytes/row.
2014-05-05 11:36:22.653 TestLocation[1465:a003] vImage decode failed, falling back to CG path.
May  5 11:36:22 infomedia-iPod-touch TestLocation[1465] <Error>: CGBitmapContextCreate: unsupported parameter combination: 5 integer bits/component; 16 bits/pixel; 3-component color space; kCGImageAlphaNoneSkipLast; 512 bytes/row.
2014-05-05 11:36:22.691 TestLocation[1465:9503] vImage decode failed, falling back to CG path.
May  5 11:36:22 infomedia-iPod-touch TestLocation[1465] <Error>: CGBitmapContextCreate: unsupported parameter combination: 5 integer bits/component; 16 bits/pixel; 3-component color space; kCGImageAlphaNoneSkipLast; 512 bytes/row.
2014-05-05 11:36:22.711 TestLocation[1465:890b] vImage decode failed, falling back to CG path.
May  5 11:36:22 infomedia-iPod-touch TestLocation[1465] <Error>: CGBitmapContextCreate: unsupported parameter combination: 5 integer bits/component; 16 bits/pixel; 3-component color space; kCGImageAlphaNoneSkipLast; 512 bytes/row.
2014-05-05 11:36:22.725 TestLocation[1465:9003] vImage decode failed, falling back to CG path.
May  5 11:36:22 infomedia-iPod-touch TestLocation[1465] <Error>: CGBitmapContextCreate: unsupported parameter combination: 5 integer bits/component; 16 bits/pixel; 3-component color space; kCGImageAlphaNoneSkipLast; 512 bytes/row.
2014-05-05 11:36:22.733 TestLocation[1465:9b03] vImage decode failed, falling back to CG path.
May  5 11:36:22 infomedia-iPod-touch TestLocation[1465] <Error>: CGBitmapContextCreate: unsupported parameter combination: 5 integer bits/component; 16 bits/pixel; 3-component color space; kCGImageAlphaNoneSkipLast; 512 bytes/row.
2014-05-05 11:36:22.736 TestLocation[1465:8b03] vImage decode failed, falling back to CG path.
May  5 11:36:22 infomedia-iPod-touch TestLocation[1465] <Error>: CGBitmapContextCreate: unsupported parameter combination: 5 integer bits/component; 16 bits/pixel; 3-component color space; kCGImageAlphaNoneSkipLast; 512 bytes/row.
2014-05-05 11:36:22.777 TestLocation[1465:9207] vImage decode failed, falling back to CG path.

检查了非常多遍,代码一模一样,就是代理方法不执行,到网上搜了好多资料,没有解决。最后想到在xcode5和xcode4.6下开发的差异,预计是arc捣的鬼,然后把arc改为NO,结果就正常执行了。顺便把代码贴出来……


工具:xcode5.0

1.新建一个single view application ,导入map kit和core location库,将arc改为NO

2.ViewController.h文件

#import <UIKit/UIKit.h>
#import <MapKit/MapKit.h>
#import <CoreLocation/CoreLocation.h>

@interface ViewController : UIViewController<CLLocationManagerDelegate> {
    MKMapView *_mapView;
    UILabel *_showLabel;
}

@end

ViewController.m文件


3.MapAddress.h文件

#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>

@interface MapAddress : NSObject

+ (NSString *) getBaiduAddress:(CLLocation *)location;
+ (NSString *) getGoogleAddress:(CLLocation *)location;
@end

MapAddress.m文件