#import <UIKit/UIKit.h>
@interface AddRecipientsTableViewController : UITableViewController {
NSMutableArray *recipientItems;
}
-(IBAction) btnLocalRecipients;
-(IBAction) btnRemoteRecipients;
-(IBAction) btnNext;
@end
在我的实现中,我有:
#import "AddRecipientsTableViewController.h"
#import "AddLocalRecipientsTableViewController.h"
#import "AddRemoteRecipientsTableViewController.h"
@implementation AddRecipientsTableViewController
-(IBAction) btnLocalRecipients{
AddLocalRecipientsTableViewController *addLocalRecipientsTableViewController = [[AddLocalRecipientsTableViewController alloc]init];
addLocalRecipientsTableViewController.navigationItem.title=@"Local Recipients";
[self.navigationController pushViewController:addLocalRecipientsTableViewController animated:YES];
[addLocalRecipientsTableViewController release];
}
如何在 addLocalRecipientsTableViewController 中设置recipientItems 的值?
最佳答案
您有两个选择。
选项A 在 AddLocalRecipientsTableViewController 中创建一个 init 方法,该方法接受指向recipientItems 的指针。
如果我想在 viewController 内管理添加,我会选择选项 A。
选项B 创建新收件人时,使用 NSNotifications 发送该收件人。
如果我想在一个类 AddRecipientsTableViewController 中管理与收件人项目相关的所有任务,我会选择选项 B。
关于iphone - 如何设置以下代码片段中的recipientItems的值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6090555/