Google Maps Help

3 views
Skip to first unread message

William Frowine

unread,
Feb 16, 2012, 6:05:39 PM2/16/12
to pdx-cocoa...@googlegroups.com
Hi Guys:

I have one simple question.  I have an NSString called locale the I need it to be set as "Current Location" so that when i pass the following to Google Maps determines the user's location and destination.  I just keep getting errors on the 2nd line so obviously I'm setting it wrong.  Does anyone see what I should do instead for line 2.

NSString *locale; 
    [locale setText:@"Current Location"];

    

    

    

    NSString *finalURL = [NSString stringWithFormat:@"http://maps.google.com/?daddr=%@&%@SADDR=%@",
                          [addressid.text stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
                          [csz.text stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
                          [locale stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]
                          ];

    

    NSURL *googleMapsURL = [NSURL URLWithString:finalURL];

    

    [[UIApplication sharedApplication] openURL:googleMapsURL];


Janine Ohmer

unread,
Feb 16, 2012, 6:07:08 PM2/16/12
to pdx-cocoa...@googlegroups.com
What's the error?

janine

Justin R. Miller

unread,
Feb 16, 2012, 6:12:18 PM2/16/12
to pdx-cocoa...@googlegroups.com
The method setText: isn't valid for NSString. Try locale = @"Current Location".

JM

On Feb 16, 2012, at 3:05 PM, William Frowine wrote:


--

Justin R. Miller
http://codesorcery.net

William Frowine, PMP

unread,
Feb 16, 2012, 6:12:26 PM2/16/12
to pdx-cocoa...@googlegroups.com
Janine:

Thanks for your quick response.  It says that setText is deprecated.

Janine Ohmer

unread,
Feb 16, 2012, 6:14:16 PM2/16/12
to pdx-cocoa...@googlegroups.com
I think Justin's got your answer (I was actually looking at the next line, duh!).

janine

Northwest Mobile Development LLC

unread,
Feb 16, 2012, 6:51:22 PM2/16/12
to pdx-cocoa...@googlegroups.com
Thanks guys!
----------------
William Frowine, PMP
Northwest Mobile Development LLC
in...@nwmobiledev.com
Reply all
Reply to author
Forward
0 new messages