2011-05-22 60 views
0
#import <UIKit/UIKit.h> 
@interface AddRecipientsTableViewController : UITableViewController { 
NSMutableArray *recipientItems; 
} 
-(IBAction) btnLocalRecipients; 
-(IBAction) btnRemoteRecipients; 
-(IBAction) btnNext; 
@end 

我在执行我:如何在下面的代码片段中设置recipientItems的值?

#import "AddRecipientsTableViewController.h" 
#import "AddLocalRecipientsTableViewController.h" 
#import "AddRemoteRecipientsTableViewController.h" 


@implementation AddRecipientsTableViewController 

-(IBAction) btnLocalRecipients{ 

    AddLocalRecipientsTableViewController *addLocalRecipientsTableViewController = [[AddLocalRecipientsTableViewController alloc]init]; 
    [email protected]"Local Recipients"; 
    [self.navigationController pushViewController:addLocalRecipientsTableViewController animated:YES]; 
    [addLocalRecipientsTableViewController release]; 

} 

如何设置recipientItems值从内部addLocalRecipientsTableViewController?

回答

1

你有两种选择。

选项A 创建您的AddLocalRecipientsTableViewController的init方法接受一个指向recipentItems。

我会选择选项A,如果我想要管理viewController内添加。

选项B 使用NSNotifications在创建时发送新收件人。

如果我想要在一个类AddRecipientsTableViewController中管理与recipientItem相关的所有任务,我会选择选项B.

相关问题