Passing UITableView's with parsing XML
Posted
by
Luai Kalkatawi
on Stack Overflow
See other posts from Stack Overflow
or by Luai Kalkatawi
Published on 2013-06-25T07:06:05Z
Indexed on
2013/06/25
10:21 UTC
Read the original article
Hit count: 219
I am parsing XML and I select from the UITablevView but I have an issue that how I am going to change the link on each selection?
For example;
www.example.com/test12.php?d=0
www.example.com/test12.php?d=1&il=istanbul
www.example.com/test12.php?d=2&il=istanbul&ilce=kadikoy
How can I change the d= and il= and ilce= value on each select on the UITableView?
I have write this but couldn't go further.
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *selectedCell = [tableView cellForRowAtIndexPath:indexPath];
NSString *cellText = selectedCell.textLabel.text;
NSString *linkID = @"http://example/test12.php?d=@%&il=@%";
NSLog(@"%@ Selected", cellText);
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
containerObject = [objectCollection objectAtIndex:indexPath.row];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:CellIdentifier];
}
// Set up the cell...
cell.textLabel.text = containerObject.city;
return cell;
}
Thanks from now.
© Stack Overflow or respective owner