I have a UserDetails class. I have a function in another class B(TableViewController) which contains an object of the UserDetails class, something like this:
-(void)sendData: (UserDetails *) user {
//some code
}
Now I have another function in a third class C (TableViewController) where I want to use the value contained in the variable “user”. How do I do it?
In the third class, set up a property of type UserDetails.
When you move from B to C (either in the prepareForSegue or where you init the TVC and push it) just pass the UserDetails object into C so it has its own version. That way you keep is simple.