My IOS app needs to put a number behind a string. The number is received by the index of the cell that is being pushed. however if i run the app and push a cell. My screen goes to xCode showing that there is a variable called tempstring. the simulator however does not respond anymore.. How can i fix this? This is the code i use:
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSString *tempstring = [NSString stringWithFormat: @"http://www.app-creater.com/service.php?k=%i",indexPath.row];
NSLog(tempstring);
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
// Retrieve cell
NSString *cellIdentifier = @"BasicCell";
UITableViewCell *myCell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
// Get the location to be shown
Location *item = _feedItems[indexPath.row];
// Get references to labels of cell
myCell.textLabel.text = item.Name;
return myCell;
}
I get a thread 1: breakpoint 1.1 at the NSlog(tempstring) Saying incomplete format specifier.
How can i fix this?
-EDIT-
What i want to achieve is to get the string: "www.app-create.com/service.php?k=1" (or any number) with that string i want to download a partial JSON piece so in example the Password piece, corresponding to the string number. so for example that link is for the email address: tet@icloud.com, i get the password 1234, for the link www.app-create.com/service.php?k=0, i get password 4321