Closed jermowatson closed 9 years ago
Well, took me a few minutes to figure this one too - with the self
being omitted. But it's a simple typo. My typo.
It has already been fixed. Tomorrow that 1.4 will be released, you'll see a fix for that included as well. :)
Nice! I'm slowly going through each function of mine to work out the issues. All good though.
I'm not even sure how to classify this however, I'll just provide the details and you can update the title to reflect accordingly as I honestly don't know.
When converting a TableView Function numberOfRowsInSection there seems to be an issue when assigning or configuring self attributes among array count function.
Please test with the following code.
(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { self.tabBarController.delegate = self; if (platesArray != nil || [platesArray count] != 0) {
} else { //Return nothing as something has gone wrong with the array. return 0; } }
Expected results: (PLEASE NOTE THIS IS ONLY WHAT I THOUGHT IT SHOULD BE AND MAY NOT BE CORRECT) func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { self.tabBarController.delegate = self if platesArray != nil || platesArray.count() != 0 { var selectedVC: UIViewController = self.tabBarController.viewControllers.objectAtIndex(self.tabBarController.selectedIndex) var selectedItemTag: String = selectedVC.tabBarItem.title NSLog("%@", selectedItemTag) if selectedItemTag.isEqualToString("Approach") { return approachArray.count } if selectedItemTag.isEqualToString("Airport") { return airportArray.count } if selectedItemTag.isEqualToString("Arrivals") { return arrivalArray.count } if selectedItemTag.isEqualToString("Departures") { return departureArray.count } else { return platesArray.count } } else { return 0 } }
Actual Results: func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { .delegate=self if platesArray!=nil||platesArray.count()!=0 { var selectedVC: UIViewController = .viewControllers.objectAtIndex(.selectedIndex) var selectedItemTag: String = .title NSLog("%@",selectedItemTag) if selectedItemTag.isEqualToString("Approach") { return .count;