2011-05-22 48 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.

相關問題