vendredi 8 mai 2015

Passing data to NSObject

I have a HomeModel based app. If a user logs in the app sends his personal code to the next view controller that automatically combines an URL and his personal code. That all works fine. But i need to use that url in the HomeModel file, but if I import the the combined label in the HomeModel file it is empty. Please help me... Here's my code in the ViewController.m:

_labelSceneTwo.text = _labelText;
_urlTextString = _urlText.text;
[_twoCombined setText:[NSString stringWithFormat:@"%@%@", _urlTextString, _labelText]];
_twoCombinedString = _twoCombined.text;
myURL = _twoCombinedString;

And here's my code in the HomeModel.m

ViewController *vc = [[ViewController alloc] init];
_myUrlString = vc.twoCombinedString;
NSURL *jsonFileUrl = [NSURL URLWithString:_myUrlString];

Aucun commentaire:

Enregistrer un commentaire