I was trying to get the name from the database fromUser which is a relation object .
for restaurant in currentPage as! [Activity] {
print("Restaurant name = \(restaurant.status)")
self.status.append(restaurant.status!)
self.user.append((restaurant.fromUser?.name)!)
let dateString = dateFormatter.stringFromDate(restaurant.created!)
self.date.append(dateString)
}
As you can see i was trying to append the name into an String Array and i got an error while extracting it from the line of code
self.user.append((restaurant.fromUser?.name)!)
Is this the correct way of doing it?
To help you we need TO REPRODUCE your problem, but we cannot do it without all classes of your example. So, please add here in attachment your project (or at least a file with all classes - maybe, ViewController.m)
i think i have bad explanation to my problem . Sorry . But what i really meant is that how can i get relation object name .Like Activity Class got a relational object which is pointing to Users Class and I want to get the name from it .