this is my first question, sorry if something is wrong
Well I'm trying to create a view in which i can select a friend from a table view and then it should say the number and the mail on a UIAlertView but I dont know how to do this the friend list is obtained from an xml file on my site, and then is parsed an showed on a table with a custom cell design
this is the code that creates each cell
- (UITableViewCell *)tableView:(UITableView *)myTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = (UITableViewCell *)[self.messageList dequeueReusableCellWithIdentifier:@"ContactListItem"];
if (cell == nil) {
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"ContactListItem" owner:self options:nil];
cell = (UITableViewCell *)[nib objectAtIndex:0];
}
NSDictionary *itemAtIndex = (NSDictionary *)[messages objectAtIndex:indexPath.row];
UILabel *userLabel = (UILabel *)[cell viewWithTag:2];
userLabel.text = [itemAtIndex objectForKey:@"user"];
return cell;
}
thanks Santiago
You have to implement the
didSelectRowAtIndexPath:
method.-(void)tableView:(UITableView*)tableView didSelectRowAtIndexPath is the method you would need to implement. This is assuming the view you are presenting the table view in is the delegate for the table view.