tags:

views:

145

answers:

2

In Visual Studio projects I almost always use the App_Code folder or a reference to a separate class library to store my most commonly used Methods, like a method that formats dates.

Where and how should I do the same when developing an iPhone App using Xcode?

Is this best practice when it comes to iPhone Apps?

+1  A: 

You're talking about common code you want to share between projects, right?

There are a few ways to handle this. Building your own Framework is one possibility, you can see this in action in OmniGroup's open source framework. In my opinion though, building a framework can be pretty cumbersome. I prefer to simply keep a directory of source files that I can reference (not copy) from each project I'm using them in. I don't even do that much anymore in my Cocoa projects though, it seems like most of the truly portable code that I have a use for in multiple projects has been included in successive releases of Cocoa.

Marc Charbonneau
Building your own framework is almost always a bad idea. YAGNI.
Roger Nolan
A: 

See this very similar SO question: Whats the easiest way of implementing own functions that are used all over the place

Roger Nolan