ios - Any way to use common variable for all tab in tabbarcontroller? -
i creating 4 tab in tabbarcontroller,i want use common variable name in tabs how that
thanks
by declaring object in appdelegate easiest way access object in 4 tab. like..
appdelegate.h
@property (strong, nonatomic) nsstring *strname; viewcontroller.m
#import "appdelegate.h" appdelegate *appdelegate = [[uiapplication sharedapplication] delegate]; //set value appdelegate.strname = @"some value"; //get value nslog(@"%@",appdelegate.strname);
Comments
Post a Comment