【发布时间】:2012-10-03 02:00:56
【问题描述】:
我有一个 ViewControllerA 和一个 ViewControllerB。我想从 ViewControllerB 调用 ViewControllerA 的方法。
在 ViewControllerA 中存在一个方法:
-(NSMutableArray*) loadData;
在 ViewControllerB.h 中:
#import "ViewControllerA.h"
.......
@property (nonatomic, strong) ViewControllerA * viewControllerA;
@property (nonatomic, strong) NSMutableArray * mutableArray;
在 ViewControllerB.m 中:
self.mutableArray =[viewControllerA loadData];
但该方法没有调用。为什么?提前致谢
【问题讨论】:
-
你是否将函数添加到视图控制器的标题中?
-
你的意思是 viewControllerA 中的方法是类方法吗?
标签: iphone ios methods uiviewcontroller