ios - objective c and iphone map route issue -


i have been using link polyline points content of link

i have expression polyline points

nsstring* apiurlstr = [nsstring stringwithformat:@"http://maps.google.com/maps??output=dragdir&saddr=%@&daddr=%@", saddr, daddr];  nsregularexpression *regex = [nsregularexpression regularexpressionwithpattern:@"points:\\\"([^\\\"]*)\\\"" options:0 error:null];  nstextcheckingresult *match = [regex firstmatchinstring:apiresponse options:0 range:nsmakerange(0, [apiresponse length])];  nsstring *encodedpoints = [apiresponse substringwithrange:[match rangeatindex:1]]; 

but code returns encodedpoints nil in response

this response link above in xcode:

link code: response content

how encoded points using regular expression? problem in code? working fine before 2 days. don't know problem.

you should use webservice. google maps provides api.

your issue you're downloading web page. said working 2 days ago? well, may have change page since then.
example, there string "points:" in document. why regex fails. if tomorrow change source code of page (as may have happened since 2 days ago), you're redo it, whereas api should not change (or @ least keeps working few moments, years, etc. deprecated version).


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -