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

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -