我想從畫廊/攝像頭添加圖片到NSMutableDictionary
&我使用,我發現Here數組對象更新未指派
[dict setObject:UIImageJPEGRepresentation(chosenImage,0.5) forKey:@"image_four"];
[documents replaceObjectAtIndex:0 withObject:dict];
[tableOne reloadData];
細胞用於排在Indexpath
[cell.oneImgView setImage:[[UIImage alloc]initWithData:[dict objectForKey:@"image_four"]]];
我下面的方法m將NSMutableDictionary對象添加到ViewController中的一個全局數組中A &將它發送到ViewController B,我從圖庫/相機添加/更新圖像。
但是當我按回按鈕並返回UIViewController
A,然後再次去查看控制器B這些圖像仍然在該數組中。
總之,每當我添加圖片到UIViewController
B的陣列它的一些如何影響到UIViewController
A.
我想這是上進行點擊按鈕完成,但數組,如果我點擊導航欄上的後退按鈕它與完成按鈕相同。
- (IBAction)goToBack:(id)sender {
[self.navigationController popViewControllerAnimated:YES];
}
有人能告訴我我哪裏出錯了嗎?
你現在想做什麼? – user3182143
什麼是這條線「但是當我按回按鈕,並返回UIViewController A,然後再次去查看控制器B這些圖像仍然在該數組中」? – user3182143
我的問題是,當我將圖像數據添加到字典並將其更新到視圖控制器b的數組,然後它在前面的視圖控制器A的主數組中改變,沒有理由也沒有代碼做這樣的事情。 –