i was wondering if someone could help me out with this, its probably really simple yet its stumping me
what i want to do is take a value out of a sqlite database...
in this case 4, and apply them to a button command execution which will take those values, and feed them into this command
here is my code
does that make sense?
basically instead of having a fixed set of data in
NSString* addressText = @"1 Infinite Loop, Cupertino, CA 95014";
i want the variables extracted from the sqlite3 database
do i just set them in? like
NSString* addressText = @"Address, Town, State, Zip";
or do i have to change some characters around
thanks so much
what i want to do is take a value out of a sqlite database...
in this case 4, and apply them to a button command execution which will take those values, and feed them into this command
here is my code
Code:
-(IBAction)openMaps {
// Where is Apple on the map anyway?
NSString* addressText = @"1 Infinite Loop, Cupertino, CA 95014";
// URL encode the spaces
addressText = [addressText stringByAddingPercentEscapesUsingEncoding: NSASCIIStringEncoding];
NSString* urlText = [NSString stringWithFormat:@"http://maps.google.com/maps?q=%@", addressText];
// lets throw this text on the log so we can view the url in the event we have an issue
NSLog(urlText);
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlText]];
does that make sense?
basically instead of having a fixed set of data in
NSString* addressText = @"1 Infinite Loop, Cupertino, CA 95014";
i want the variables extracted from the sqlite3 database
do i just set them in? like
NSString* addressText = @"Address, Town, State, Zip";
or do i have to change some characters around
thanks so much