Tôi có một ViewControllerA và một ViewControllerB. Tôi muốn gọi một phương thức của ViewControllerA từ ViewControllerB.Phương thức gọi từ một ViewController khác
Trong ViewControllerA hiện diện một phương pháp:
-(NSMutableArray*) loadData;
Trong ViewControllerB.h:
#import "ViewControllerA.h"
.......
@property (nonatomic, strong) ViewControllerA * viewControllerA;
@property (nonatomic, strong) NSMutableArray * mutableArray;
Trong ViewControllerB.m:
self.mutableArray =[viewControllerA loadData];
nhưng phương pháp này không được gọi. Tại sao? Cảm ơn trước
bạn có thêm chức năng vào tiêu đề của bộ điều khiển chế độ xem không? –
Ý của bạn là cho phương thức trong viewControllerA là một phương thức lớp? –