tags:

views:

45

answers:

3

Hello. Thanks in advance for sending me answer. I m the beginner in iphone software development, I creating the HTTP request using SOAP XML parsing method. I was creating the variable"soapResult" for storing http coming data. I want to use the soapResult value into another class. how i used that value. I going to make it as a global variable but i doesn't know how to create and use it? Also if given method is wrong then which method i will have implementing for that?

+3  A: 

Generally, singletons are preferred over global variables.

I found this article useful on a similar matter: Cocoa with Love: Singletons, AppDelegates and top-level data

Vegar
Thanks Vegar for helping me................
RRB
How about accepting his post as an answer then. You have 0% accept rate.
Matthias
+1  A: 

I suggest you to use something like Registry pattern. Just create class Registry with static methods and static properties. It is better way to controll all shared stuff in your app

sys
This idea can work on whole application?
RRB
A: 

Global vars are not preferred in objective-c, but if you want to use, this approach works well.

EEE