I've two UITableView with custom cell, the first UITableView has array of string in UILabel and UIButton.
This is my FirstViewController(first UITableView)

And the secondViewController( second UITableView) has only UILabel.
What I'm trying to do is to click for example at the second cell UIButton "add to second table" and pass it in an array using NSUserDefaults into the secondViewController, and when i click at the first cell UIButton "add to second table" it should keep the first value and append this value with it and add it to the secondViewController.
This is my code (in firstViewController) but as you can see here I'm sending the whole array every time, is it possible to send each time String and append it together in an array in NSUserDefaults and then retrieve it in the second UITableView:
func add(sender:AnyObject){
NSUserDefaults.standardUserDefaults().setObject(array, forKey: "Array")
}
i tried to send it this way but its only sending one String not an Array of Strings :
func add(sender:AnyObject){
NSUserDefaults.standardUserDefaults().setObject(array[sender.tag], forKey: "Array")
}
Code in the secondViewController :
if (NSUserDefaults.standardUserDefaults().stringForKey("Array") != nil){
array = NSUserDefaults.standardUserDefaults().objectForKey("Array")! as! NSArray
}