views:

300

answers:

1

Here's the code in AlertTableView:

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
    NSInteger index = 12345;
    NSLog(@"AlertTableView: selecting row at index %d", index);
    [self.caller didSelectRowAtIndex:index withContext:self.context];
}

In self.caller:

- (void)didSelectRowAtIndex:(NSInteger)row withContext:(id)context {
    NSLog(@"Selected row at index %d with context %@", index, context);
}

Console output:

2009-05-07 15:51:30.619 Whiteboard[15165:20b] AlertTableView: selecting row at index 12345
2009-05-07 15:51:30.620 Whiteboard[15165:20b] Selected row at index -1758050543 with context <Picker: 0x587c20>
+3  A: 

It doesn't look like you have "index" in scope in your method, try this:

- (void)didSelectRowAtIndex:(NSInteger)row withContext:(id)context {
  NSLog(@"Selected row at index %d with context %@", row, context);
}

Just looks like a typo :)

Jonas
Perfect! Silly me.
Elliot