I have several small utility apps for iOS. I want to combine these into one app with each utility accessed from a menu. I'm trying to figure out the best way to do this. The apps use Core Data which makes things slightly more complicated. Are there any standard ways of doing this or is just a matter of glueing pieces together until I get it to work?
Thanks
I recently worked on one such application. The design was as follows
-> Each sub application registers with the container app by providing the name of it's app delegate. I'd maintained a plist for this purpose which holds a mapping of the app name and the appDelegate class.
-> Whenever the user selects an app the container app will instantiate the app delegate and add the main view controller returned by it as the root view controller.
This design helps solve the logical part of the problem. You will still have a hard time before compiling all the source code as a single project.
As far as core data is concerned you must not have a hard time with it if each of your sub application uses a different object store.
Related
I have built an app that does some computation and communication with varying internet resources. I branded my application with its tab bar navigation bar for three corporate clients, the only change was the difference in pictures and coloring. So I created three targets and handled target membership appropriately.
So far, so good. But what if I wanted to customize the whole layout of views or even the navigation of the app for a client? For example, the next client could ask for a navigation controller based interaction instead of a navigation based on a tab bar. Or to add one more label in one view. Or to use a pie chart instead of a bar graph to visualize a certain set of data.
It leads to very ugly code if you put all different targets in one project with all these if/else if/else if/else if/... blocks of code. What if I had 100 clients?
Now here is the question: In my imagination an ideal concept would be if I could make an Xcode project named "Base" that does all the domain specific computations, communications and so on (of course) and has a basic, non-branded UI. This way the code can be easily maintained for all clients in one central repository. Then, for every client, I create a whole new Xcode project, import or reference the "Base" project and when I click on Build without any customization, it already builds me the non-branded, but fully functional app. If a client requests to have a modified layout, I subclass the corresponding view. When hitting the Build button again, it should bring up the "Base" app but the certain subclassed view replaced the standard layout.
Can this idea of a "Base" app with "overriding" the visuals be done elegantly in Xcode?
I did exactly that for a client last year. I had one framework app that used a header shared with the app project. It's almost like a protocol in that the app "commits" to supplying some strings, views, and images. You can start with a fairly simple app project, and as you find you need more variation move code out of the framework into the app. The header was the implementation of a class-methods only class that vended the app specific data.
In my case we had 7 or so apps (all in the store now) yet not a single bit of knowledge in the framework of exactly what app was using it.
As an example in app did launch, the framework might query if a sound should be played and if so ask for that resource - same with images and other variations.
One way to do it would be to create a static library. You could stuff all the commonly used stuff into a static library and then reference it in the other projects.
Maybe most of the stuff lives in the static library and you just have one or two files in your app project. This would work well if there a very minimal amount of changes between applications (ie: just style changes like you mention in your post).
Another technique would be to use generated and template code. The idea would be that you have your boiler-plate code and you run a script that would set up your project and resources based on provided colors, logos, strings, etc.
In the end, you'll likely want to use a combination of the two approaches above based on your requirements.
I was thinking of writing some UIViewControllers to display the data in my Core Data stores while developing and testing an app.
I was thinking of something like this: A view controller that allows the user to select parameters to be passed into a fetch request, then a table view controller to list the fetch results, and finally a view controller to display the data in a particular entry from the fetch results.
Does anyone know of some open source code already similar to this, or a different approach I should take for monitoring my data?
NOTE: To clarify, I'm talking about a generic solution that could be put into any app using CoreData with minimal configuration.
Not a direct answer to your question but there is a new app in the mac app store which allows you to view and manipulate Core Data Stores. While it doesn't integrate in with your own app (and its not the cheapest software out there) you might find it helpful. I stumbled across it a few moments ago and thought of your question here.
http://itunes.apple.com/us/app/core-data-editor/id403025957?mt=12
Let's say you have two GWT applications: the first (which is on another server as the second) has implemented some views that can be used to change the configuration separately.
The other one can manage (and access) some of the first ones and should configure them without forcing the user to login on every site.
It would be bad to just copy the code of the configuration, because this would duplicate code and we have to maintain it for every version, because the configuration-dialogues can change between versions.
Is it possible to include / load that view into your main GWT app, so that the users can use it the same way as your main application?
You can - Display the second app in an iframe. But if you use cookies beware of same origin policy if the domains are different for the two sites.
The other solution is import the code into the new one and let it perform independently here.
(A lot depends on underlying architecture of the two apps of course)
Iam coding a dating application for facebook. The application has to have a standalone web application part and a Iframe based part which runs inside facebook canvas.
I want to know good ways to design the application. Iam using zend framework, so here is my idea.
One approach that am planning to use is this -
The application folder to contain 2 controllers, index controller being the entry point of the standalone web application and another controller- FacebookController to be the entry point of the Iframe being run inside facebook canvas. Both of them calling the same view files which get written based on which controller is writing to them.
The second approach is to have one single controller as the entry point and use 2 layout files. One for the standalone web application and one for the facebook canvas app.
The reason for choosing these approaches in that the authentication mechanism of the two applications is different.
To get an idea, have a look at www.areyouinterested.com, Iam planning to do something similar to what they have done.
Please suggest me what would be the best way to go around this.
Your first choice is best.
Two Controllers. Two layouts. Common views.
This gives you flexibility to change around a lot of one or the other without breaking the opposite one.
If you feel ambitions, I would even go with two modules. If your application is structured well enough each module will have common components that are re-usable.
I'm trying to add Core Data to an app that loads news form of an RSS feed so I can store articles offline. I am using ASIHTTP to load the data off of the internet as XML.
I'd like to store the articles in Core Data so I have them the next time I start. My AppDelegate_shared already is set up for Core Data, based on the template, but I'm not sure where to add all the rest of the code.
I found a tutorial by Ray Wenderlich, but it only confuses me. His tutorial assumes that there is a single App Delegate file, not three, as created by the Universal App templates.
Where in my three AppDelegate files (the shared, iPhone and iPad specific) does my core data article entry code go?
Are there any tutorials that deal with Core Data with the newer app template setup (3 delegate files)?
How do I read out my Core Data into a UITableView?
The Core Data stack only needs to be created in one shared location at startup. You can still have three different application delegates, as long as all three call the same setup routine. This could be done by making all three application delegates you have be subclasses of one base application delegate which handles this setup.
Another way to approach this might be to create a singleton for managing your Core Data access. See this question for other potential configurations that people have used, as well as the reasons for them.
As far as how to populate a table view with data from a Core Data database, you'll want to use NSFetchedResultsController for that. It makes displaying and updating table views simple on iOS. Jeff LaMarche has some good template code for dealing with this, and the sample applications generated when creating a new navigation-based Core Data iPhone application show this in action.
Finally, I taught a class on Core Data last semester (and finished another one last night), for which the course notes are available here and the video can be downloaded from iTunes U.
the core-data stuff belongs to the shared appdelegate. because the other two appdelegates are just subclasses of the shared one.
why not create a new universal project with coredata and look how it's done? and to see how the data is feed into a tableview, you could create a navigation-based project with coredata and look how it's done in there.