Passing data from one viewcontroller to another

Posted by user1392515 on Stack Overflow See other posts from Stack Overflow or by user1392515
Published on 2012-10-12T21:22:50Z Indexed on 2012/10/12 21:37 UTC
Read the original article Hit count: 120

I subclassed two view controllers.

The first one is supposed to pass data, a NSUrl object to the second one.

.m of the first one:

NSURL *temp = [NSURL URLWithString:@"http://example.com"];

UIViewController *presentationsFullScreen_ViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"PresentationsFullScreen_ViewController"];

presentationsFullScreen_ViewController.urlToUse = temp;

.h of the second one:

#import <UIKit/UIKit.h>

@interface PresentationsFullScreen_ViewController : UIViewController {


    NSURL *urlToUse;


}



@property (nonatomic,retain) NSURL *urlToUse;

It is obviously not working and not compiling,telling me essentially that I didn't subclass it and that the property urlToUse is not found on UIViewController.

How do I subclass correctly?

Thanks!

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about ios