如何在不同的ViewController中显示类别值

时间:2016-02-01 10:41:32

标签: ios objective-c instance categories

我有基类Connections和类别CoreDataProperties。在我的“FirstViewController”中我将数据存储到CoreDataProperties属性,我也可以使用{{Connections实例显示数据1}} class.My问题是,我想访问SecondViewController中的存储值。如果我为Connections和访问工具创建了一个对象,则会显示null

连接+ CoreDataProperties.h

@interface EY_Connections (CoreDataProperties)
@property (nullable, nonatomic, retain) NSString *connectionAddress;
@property (nullable, nonatomic, retain) NSString *connectionStatus;
@end

Firstviewcontroller.m

Connections *connect;
NSLog(@"ConnectionNo correct==>>%@",connect.connectionStatus);

它显示ConnectionStatus Value.But如果我在SecondviewController中执行此操作。它没有显示。

SecondViewController.m

Connections *conn;
NSLog(@"er==>%@",conn.connectionStatus);

问题是什么?如何在SecondViewController中显示存储的Category值?

0 个答案:

没有答案