The map agent for iOS development does not work (hint Vimage decode failed, falling back to CG path.)

Source: Internet
Author: User
Tags unsupported uikit

Project to use the map related things, the previous demo moved out, the results found that the direct operation of the demo before the problem, in XCODE5 under the new project and then paste the code will prompt

May 5 11:36:21 Infomedia-ipod-touch testlocation[1465] <error>: cgbitmapcontextcreate:unsupported parameter Combination:5 integer bits/component; Bits/pixel; 3-component color space; Kcgimagealphanoneskiplast; Bytes/row. May 5 11:36:21 Infomedia-ipod-touch testlocation[1465] <error>: cgbitmapcontextcreate:unsupported parameter Combination:5 integer bits/component; Bits/pixel; 3-component color space; Kcgimagealphanoneskiplast; 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; Bits/pixel; 3-component color space; Kcgimagealphanoneskiplast; 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; Bits/pixel; 3-component color space; Kcgimagealphanoneskiplast; 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; Bits/pixel; 3-component color space; Kcgimagealphanoneskiplast; 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; Bits/pixel; 3-component color space; Kcgimagealphanoneskiplast; 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; Bits/pixel; 3-component color space; Kcgimagealphanoneskiplast; 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; Bits/pixel; 3-component color space; Kcgimagealphanoneskiplast; 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; Bits/pixel; 3-component color space; Kcgimagealphanoneskiplast; bytes/row.2014-05-05 11:36:22.777 testlocation[1465:9207] vimage decode failed, falling back to CG path.

Check many times, the code is exactly the same, is the agent method is not executed, to the web search a lot of information, no solution. The final thought of the difference between XCODE5 and xcode4.6, estimated to be the ghost of Arc ramming, and then change the arc to no, the result is normal operation. By the way, paste the code out ...


Tool: xcode5.0

1. Create a single view application, import the map kit and core location library and change the arc to No

2.viewcontroller.h file

#import <UIKit/UIKit.h> #import <MapKit/MapKit.h> #import <CoreLocation/CoreLocation.h> @interface viewcontroller:uiviewcontroller<cllocationmanagerdelegate> {    Mkmapview *_mapview;    UILabel *_showlabel;} @end

VIEWCONTROLLER.M file

#import "ViewController.h" #import "MapAddress.h" @interface Viewcontroller () @end @implementation viewcontroller-(        void) viewdidload{[Super Viewdidload];    cllocationmanager* manager = [[Cllocationmanager alloc] init];    Accuracy of positioning manager.desiredaccuracy = kcllocationaccuracybest;    locating distance manager.distancefilter = 1;    Manager.delegate = self;        Start positioning [manager startupdatinglocation];    Map _mapview = [[Mkmapview alloc] Initwithframe:cgrectmake (0, 0, 320, 460)];    _mapview.showsuserlocation = YES; [Self.view Addsubview:_mapview];} Location succeeded-(void) Locationmanager: (Cllocationmanager *) Manager didupdatelocations: (Nsarray *) locations{//Current Location Cllocati    on* newlocation = [locations Lastobject];    nsstring* str = [mapaddress getgoogleaddress:newlocation];        NSLog (@ "%@", str);        Stop positioning//[manager stopupdatinglocation];    Map Display//location after the latitude and longitude of cllocationcoordinate2d coordinate = newlocation.coordinate; Scale Mkcoordinatespan span = MkcoordiNatespanmake (0.1, 0.1);    Determine the area to display mkcoordinateregion region = mkcoordinateregionmake (coordinate, span); Let the map show this area [_mapview setregion:region animated:yes];} Location failed-(void) Locationmanager: (Cllocationmanager *) Manager didfailwitherror: (nserror *) error{NSLog (@ "failed to locate");} @end

3.mapaddress.h file

#import <Foundation/Foundation.h> #import <CoreLocation/CoreLocation.h> @interface mapaddress:nsobject+ (NSString *) getbaiduaddress: (Cllocation *) location;+ (NSString *) getgoogleaddress: (cllocation *) location; @end

MAPADDRESS.M file

#import "MapAddress.h" @implementation mapaddress+ (NSString *) getbaiduaddress: (cllocation *) Location {double latitude    = Location.coordinate.latitude;    Double longtitude = location.coordinate.longitude; NSString *urlstr = [NSString stringWithFormat: @ "http://api.map.baidu.com/geocoder?output=json&    Location=%f,%f&key=dc40f705157725fc98f1fee6a15b6e60 ", Latitude, longtitude];    Nsurl *url = [Nsurl urlwithstring:urlstr];    NSString *s = [NSString stringwithcontentsofurl:url encoding:nsutf8stringencoding Error:nil]; return s;}                        + (NSString *) getgoogleaddress: (cllocation *) Location {nsstring *urlstr = [NSString stringWithFormat:                        @ "Http://maps.google.com/maps/api/geocode/json?latlng=%f,%f&language=zh-CN&sensor=false",    Location.coordinate.latitude, Location.coordinate.longitude];    NSLog (@ "%@", urlstr);    Nsurl *url = [Nsurl urlwithstring:urlstr]; NSString *s = [NSStRing Stringwithcontentsofurl:url encoding:nsutf8stringencoding Error:nil]; return s;} @end


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.