tags:

views:

29

answers:

2

So I have an object and I want the object to be able to use in 2 different methods. Is it possible? If not, is there any work arounds for this.

A: 

Of course. Objects live in dynamic memory and are pointed to by pointers. So long as you have a reference (the pointer) to an object you can access it from wherever you want.

NSObject *theReference = [[NSObject alloc] init];

After this call, and where theReference is in scope, you will have access to the object.

darren
A: 

Yes, this is possible. An object can be used in 2 different methods.

jojaba