我有按鈕點擊事件,目前AssetScreenPopupViewController
,在AssetScreenPopupViewController
我動態地將NSNumber
添加到NSMutableArray(emailClkArray)
。
iOS - 從目前的視圖控制器返回數據
當我關閉視圖控制器,我在我的BrowseProgrammingTools中檢索這個emailClkArray
。但我總是得到空白陣列。
我的用於呈現modalviewcontroller代碼是
- (void)imageViewTapped:(UITapGestureRecognizer *)gr {
AssetScreenPopupViewController * assetController =
[[AssetScreenPopupViewController alloc]init];
assetController.AssetContentArray = tableData_one;
assetController.myStringValue = gridPopUpController.assetName.text;
[self.navigationController presentViewController:assetController animated:NO
completion:nil];
NSLog(@"Asset ARRAY %@",assetController.emailClkArray);
[self.navigationController.delegate self];
}
的ModalViewController類方法,其中,我正在增值陣列是如下
- (IBAction)emailClkBtn:(id)sender {
[self.emailClkArray replaceObjectAtIndex:k withObject:[NSNumber numberWithInt:1]];
[self.emailBtnOutlet setBackgroundImage:newImage1 forState:UIControlStateNormal];
NSLog(@"WMA dhbc%@",self.emailClkArray);
}
,當我駁回視圖控制器我已經分配emailClkArray到
ParentViewController
像這樣的MutableArray
- (IBAction)dismissClk:(id)sender {
BrowseProgrammingTools *browsePrgTools = [[BrowseProgrammingTools alloc]init];
browsePrgTools.emailClkArray = self.emailClkArray;
[self dismissViewControllerAnimated:NO completion:Nil];
}
當我在BrowseProgrammingTools
viewDidAppear
方法打印此陣這樣
-(void)viewDidAppear:(BOOL)animated{
[super viewDidAppear:YES];
self.emailClkArray = [[NSMutableArray alloc]init];
NSLog(@"DNW%@",self.emailClkArray);
}
我越來越喜歡這個空白陣列
DNW(
)
請幫我如何獲得價值?
感謝您的幫助。 – nikk3008