Create a new class to inherit NSObject
#import <foundation/foundation.h> @interface finxingdate : nsobject #pragma mark-Create a singleton method //as the difference ID of the return value (generic pointer) does not know the specific object Instancetype can dynamically identify which type of //the naming habit, share + class name //+ ( Sharedata *) + (instancetype) sharefinxingdate; //through the property to host the @property (nonatomic , strong ) nsstring *inputstring; @end
@implementation FinxingDate// static 保值作用staticnil;// 单例类使用此方法,创建单例+ (instancetype)shareFinxingDate{ // 第一次必须执行完 if (nil == date) { date = [[FinxingDate alloc] init]; } return date;}@end
Assign the value you want to pass to [FinxingDate shareFinxingDate].inputString the
It is possible to pass values across multiple pages.
Copyright NOTICE: This article is Outlan original article, without BO Master permission cannot reprint.
Ui_singleton (single-pass value)