Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var players = [String]()
- var total = [String]()
- var addTotal:AnyObject!
- var addTotalFinal:Int!
- var addPlayers:AnyObject!
- var addPlayersFinal:Array<Int>!
- @IBOutlet weak var tableView: UITableView!
- var test: AnyObject!
- override func viewDidLoad() {
- super.viewDidLoad()
- Parse.setApplicationId("KZ758LUTQZQ9Kl69mBDkv7BNLGHyXeKmqtFf7GmO", clientKey: "lOK5rg7wKeTRXZGV7MZBlQ5PTpNlGO0mkgtLkLgH")
- var query = PFQuery(className:"runningTotal")
- query.whereKey("total", notEqualTo: 0)
- query.findObjectsInBackgroundWithBlock
- {
- (objects: [AnyObject]!, error: NSError!) -> Void in
- if error == nil
- {
- var i = 0
- while i < objects.count
- {
- self.addTotal = objects[i]["total"]
- self.addTotalFinal = self.addTotal as Int
- self.addPlayers = objects[i]["players"]
- self.addPlayersFinal = self.addPlayers as Array
- self.players.append("(self.addPlayersFinal)")
- self.total.append("(self.addTotalFinal)")
- ++i
- }
- }
- else
- {
- }
- }
- navigationItem.title = "(players)"
- }
- func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int
- {
- return players.count
- }
- func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell
- {
- var cell = tableView.dequeueReusableCellWithIdentifier("MyCell", forIndexPath: indexPath) as UITableViewCell
- cell.textLabel.text = "(players[indexPath.row]) - (total[indexPath.row])"
- return cell
- }
- [[1, 11, 12, 24, 25]]
- [2]
- [[1, 11, 12, 24, 25], [1, 5, 24, 25, 31]]
- [2, 4]
- [[1, 11, 12, 24, 25], [1, 5, 24, 25, 31], [2, 12, 25, 15, 31]]
- [2, 4, -1]
- [[1, 11, 12, 24, 25], [1, 5, 24, 25, 31], [2, 12, 25, 15, 31], [24, 22, 25, 31, 20]]
- [2, 4, -1, -6]
- [[1, 11, 12, 24, 25], [1, 5, 24, 25, 31], [2, 12, 25, 15, 31], [24, 22, 25, 31, 20], [1, 2, 3, 4, 5]]
- [2, 4, -1, -6, 5]
- [[1, 11, 12, 24, 25], [1, 5, 24, 25, 31], [2, 12, 25, 15, 31], [24, 22, 25, 31, 20], [1, 2, 3, 4, 5], [1, 10, 11, 2, 12]]
- [2, 4, -1, -6, 5, 1]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement