Possible Duplicate:
How to send an NSString to another view controller
I’ve made a class (classA) which stores data. classB sends it the data. What happens is that classB sends classA an object then the object is deleted in classB. I think the problem with my program is that when the object is deleted from classB, it is deleted from classA because I guess there is only one real ‘copy’ of the object. Have I understood it right? How would I solve this problem? I can only think of duplicating the object in classB but it there a better way?
Thanks
In objective-c object deletes when it’s retain count is equal to 0. So, if your classB want this passed object to exist, just retain it and release after it is not needed. If it is a property, declare property as retain(or strong, uf you using arc).