I've been having issues with passing an array of strings between a containing app and the watch app and I had posted a question earlier about receiving the error String is not identical to AnyObject
- 'String' is not identical to 'AnyObject' error
When I posted that question I was declaring the watch app's arrays like so:
var tempNames = [""]
var tempAmounts = [""]
var tempDates = [""]
Now I am declaring them like this:
var tempNames = []
var tempAmounts = []
var tempDates = []
This resolves the other error, however I am now getting an error on a different line. Now when I try to display the strings in the TableView I get the error 'AnyObject' is not convertible to 'String'
. Here is my code:
for (index, tempName) in enumerate(tempNames) {
let rowNames = recentsTable.rowControllerAtIndex(index) as RecentsTableRowController
rowNames.nameLabel.setText(tempName)
}
for (index, tempAmount) in enumerate(tempAmounts) {
let rowAmounts = recentsTable.rowControllerAtIndex(index) as RecentsTableRowController
rowAmounts.amountLabel.setText(tempAmount)
}
for (index, tempDate) in enumerate(tempDates) {
let rowDates = recentsTable.rowControllerAtIndex(index) as RecentsTableRowController
rowDates.dateLabel.setText(tempDate)
}
I get the error on the rowNames.nameLabel.setText(tempName)
line.
Where am I going wrong?