简体   繁体   中英

Access from view to object in appdelegate

I would like to acces to a object in appdelegate from diferent views. I mean, in the appdelegate I have a object which I need in diferent view but I don't know how get the instance. In my app, I have only one object with information from the user and I need this data from diferents views.

yourObject * obj = [(YourAppDelegate *)[[UIApplication sharedApplication]委托] yourObject];

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM