properties - How can I get access to property from another view controller in iOS? -


i'm developing application contains menuviewcontroller ( tableviewcontroller) has cell called "profilecell" display user's first name can imported viewcontroller "userviewcontroller" has user's first name property recovered login facebook or twitter or google plus.my problem property firstname isn't null in "userviewcontroller" when want access in menuviewcontroller , return null.i have searched in net , have seen other similar issues can't resolve issue.

this code :

    case 2 : {           nsstring *cellidentifier = [[nsstring alloc] initwithformat:@"profilecell"];         profiletableviewcell *cell= [tableview dequeuereusablecellwithidentifier:cellidentifier];         userviewcontroller *uservc = [[userviewcontroller alloc]init];         cell.cellnamelabel.text = [nsstring stringwithformat:@"%@",uservc.firstname];          return cell;         break;     } 

you shouldn't create new userviewcontroller there, suppose.

does menuviewcontroller have property or variable pointing userviewcontroller? if so, should use stored value.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -