【发布时间】:2012-10-12 21:22:50
【问题描述】:
我继承了两个视图控制器。
第一个应该传递数据,一个 NSUrl 对象给第二个。
.m 的第一个:
NSURL *temp = [NSURL URLWithString:@"http://example.com"];
UIViewController *presentationsFullScreen_ViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"PresentationsFullScreen_ViewController"];
presentationsFullScreen_ViewController.urlToUse = temp;
.h 第二个:
#import <UIKit/UIKit.h>
@interface PresentationsFullScreen_ViewController : UIViewController {
NSURL *urlToUse;
}
@property (nonatomic,retain) NSURL *urlToUse;
它显然不工作也不编译,本质上告诉我我没有子类化它,并且在 UIViewController 上找不到属性 urlToUse。
如何正确子类化?
谢谢!
【问题讨论】:
-
您是否将故事板中目标视图控制器的类设置为您的自定义子类?
标签: objective-c ios uiviewcontroller viewcontroller