Please do not post the same thing multiple times. The board software automatically flags certain posts as needing moderator attention. This happens the most often for new users. I'm pretty sure this is made clear at the time you attempt to post. Posting the same thing over and over again just makes that many more posts the moderators have to weed through later. This makes us sad. Don't make us sad. If your post/thread doesn't appear, just wait a while. Don't post it again. If it hasn't shown up by the next day, then you can try again. I normally go through posts in the mornings, and try to check a few times throughout the day, but I'm not here 24/7. There will typically be a significant delay before posts are approved. Just be patient.
I have a couple of functions that will be used by various classes within the app that I'm building, for example one of them is a JSON parser that will be parsing returned data from a web service. As I am making calls to the web service from various classes, I want to define the parser in only one spot, rather than having to declare it in each class it's used.
What I'm wondering is where to place these in my document structure. Right now, I have placed them in my SynapseAppDelegate class (Synapse is the name of my project), and then to call them, I'm using:
I recommend that you put all communication with the web service into a singleton engine class. You would access that similar to how you access the app delegate right now, but it will make your life much easier in the future as you might want to re-use the web service in other apps. Having it in it's own class you can reuse it via drag'n'drop.
Also in the interest of lose coupling you will want to minimize using app delegate as a central pool of shared data and methods and instead put these things into one or more engine classes.
regards
Oliver Drobnik
Cocoanetics - Our DNA is programmed in Objective-C.
Replies
I recommend that you put all communication with the web service into a singleton engine class. You would access that similar to how you access the app delegate right now, but it will make your life much easier in the future as you might want to re-use the web service in other apps. Having it in it's own class you can reuse it via drag'n'drop.
Also in the interest of lose coupling you will want to minimize using app delegate as a central pool of shared data and methods and instead put these things into one or more engine classes.
Oliver Drobnik
Cocoanetics - Our DNA is programmed in Objective-C.
Linguan makes
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeThis is the hard thing about learning a new language - I don't know the big picture yet!
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome