tags:

views:

16

answers:

1

Hello, 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. Can somebody help me, please?

Thanks in advance

A: 

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

Benj
Thank you very much, I try asap :)
mapega
one question, Have I release after use obj?
mapega
No. You should read memory management guide :http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/MemoryMgmt/MemoryMgmt.html
Benj