UIlabel into a url?

i created a uilabel that contains my location data using this code,

longitudedata.text = [NSString stringWithFormat:@"longitude=%f", location.coordinate.longitude];
speeddata.text = [NSString stringWithFormat:@"speed=%f", [location speed] * 2.2369];
altitudedata.text = [NSString stringWithFormat:@"altitude=%f", [location altitude]];

but now i need to add these in a url so it will send that data to my server but everything iv tried dosnt work :(

NSURL *myURL = [NSURL URLWithString:[@"http://servername/ldtracker.aspx?id=3&" stringByAppendingString:longitudedata.text]];

and so on but this dosnt work, seems like iv tried everything

im a beginner to xcode, please help :)

Answers


UILabels dont handle urls, u need to give them a NSString. label.text = [NSString stringWithFormat:@"http://servername/ldtracker.aspx?id=3&%@", longitudedata.text];

this should work if i understood ur problem correctly


NSURL *myURL = [NSURL URLWithString:[NSString stringWithFormat:@"http://servername/ldtracker.aspx?id=3&%@&%@%@",longitudedata.text,speeddata.text,altitudedata.text]];

Need Your Help

How to prevent users to see the database file I am using?

database visual-studio-2010 security password-protection

I am writing a VB.NET desktop application relying on a MS Access *.accdb database. When my application is installed on the end user machine, the database file has to be in the same directory as the

can i find text in the computer's RAM (windows 7)

python memory windows-7 vb6 ram

I'd like to scan the whole RAM on a local machine for a string / hex code.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.