there is my code. In this view I want to set all the 16 text label using an array. when I press the button under one of these text label i need to change the data whit a string from a granigliatoreTF and then reload all the 16 text labels. I have implemented only one button for start. Thanks to all
import UIKit
import CoreData
class DisposizioneGranigliatori: UIViewController, UIPickerViewDelegate , UIPickerViewDataSource {
var disposizione = [NSManagedObject]()
@IBOutlet var granigliatoreTF: UITextField!
@IBOutlet var principale1LB: UILabel!
@IBOutlet var principale2LB: UILabel!
@IBOutlet var principale3LB: UILabel!
@IBOutlet var principale4LB: UILabel!
@IBOutlet var principale5LB: UILabel!
@IBOutlet var principale6LB: UILabel!
@IBOutlet var principale7LB: UILabel!
@IBOutlet var principale8LB: UILabel!
@IBOutlet var secondario1LB: UILabel!
@IBOutlet var secondario2LB: UILabel!
@IBOutlet var secondario3LB: UILabel!
@IBOutlet var secondario4LB: UILabel!
@IBOutlet var secondario5LB: UILabel!
@IBOutlet var secondario6LB: UILabel!
@IBOutlet var secondario7LB: UILabel!
@IBOutlet var secondario8LB: UILabel!
@IBOutlet var modifiche: UIView!
@IBOutlet weak var picker: UIPickerView!
var pickerData : [[String]] = [[String]]()
override func viewDidLoad() {
super.viewDidLoad()
modifiche.hidden = true
pickerData = [["12","161","164","165","176","177","245","246","247","250","255","256","262","263","266","267","268","269","270","271","274","275","278","287","289","290","293","301","303","306","307","308","328","330","336","337","340","344","346","347","352","355","357","374","377","381","383","387","391","394","395","399","400","401","403","417","421","423","430","F365","TGF 2666","FTS 2061"],["00","0,09","0,10","0,12","0,12-00","1400","Z","0,14-0,12","0,14","0,16","0,18","0,21","0,25","0,31","0,40","0,52","0,71"]]
self.picker.delegate = self
self.picker.dataSource = self
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
// The number of columns of data
func numberOfComponentsInPickerView(pickerView: UIPickerView) -> Int {
return pickerData.count
}
// The number of rows of data
func pickerView(pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int {
return pickerData[component].count
}
// The data to return for the row and component (column) that's being passed in
func pickerView(pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? {
return pickerData[component][row]
}
}
@IBAction func bigbagPrinc1(sender: AnyObject) {
}
@IBAction func bigbagSec1(sender: AnyObject) {
}
}