2011-05-29 74 views

回答

2

在你的remote recipients table view controller,你有你正在加载表(例如myTestArray)的阵列。保持它作为一个财产。还有一个NSInteger属性(说selectedRow),它将标识哪个行用户选择。而当你回到add recipient table view controller,就可以知道哪一行是由

[remoteRecipientsController.myTestArray objectAtIndex:remoteRecipientsController.selectedRow]; 

或者使用代表选择。在选择行时,远程收件人将回电,通知选择了哪一行。

更新: 如果您没有访问视图控制器,请使用委托。

你可以得到两个数组和委托方法选定行,东西如下:

-(void) remoteRecipient:(RemoteRecipientController *) remoteRecipientController didSelectRow:(NSInteger) row { 
// Get the selected row 
... = [remoteRecipientController.myTestArray objectAtIndex:row ]; 
} 

或者你也可以配置代理只返回选定行(作为字符串),东西为如下:

-(void) remoteRecipient:(RemoteRecipientController *) remoteRecipientController didSelectRow:(NSString *) selectedRecipient { 

} 

Ofcourse,在这种情况下,您需要让远程收件人控制器将所选行作为NSString在委托中传递。

+0

是的,但我无法访问我的“添加收件人”控制器中的远程视图控制器。 – jini 2011-05-29 06:57:23

+0

如果您没有访问视图控制器的使用委托(我假设您使用xib创建视图)。 – 2011-05-29 07:38:55

相关问题