I am using Xcode 4.2 storyboard. I am stuck in this concatenation. Is this right? Where in the code i've to modify? actually i want to display a new tableview depending on the variable passed ("row") from previous tableview. Any help appreciated.
self.newrow =row;// row is the variable passed from previous tableview
NSString *urlString = [NSString stringWithFormat: @"http://ipaddress/iphone.php?id="];
NSString *urlStr=@"";
urlStr=[urlString stringByAppendingString:newrow];
NSURL *url = [NSURL URLWithString:urlStr];
NSURLRequest *request = [[NSURLRequest alloc] initWithURL: url];
NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
[connection release];
[request release];
Since self.newRow
is an integer change your code to:
NSString *urlStr = [urlString stringByAppendingFormat:@"%i", self.newrow];
The format converts the integer to a string representation.
Several statements can be combined without loosing clarity:
NSString *urlString = [NSString stringWithFormat: @"http://ipaddress/iphone.php?id=%i", self.newrow];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With