So had a question about my first real application i am working on. Say im looking to create a application where if i click on a button it brings up a table of , let's say medicines say 30.So say i click on Ibuprofen and it brings up a table of brands of Ibuprofen. Then once they click on that it brings up a new NIB file. describing the Ibuprofen brand and where its made ect...
Now my Question is....
How many Nib files is recommended in a application, say if i have a 100 or more is that bad? Would it be better off going towards a database? If someone could point me in the right direction it would be greatly appreciated.
My only concern is say i have 12 types of Ibuprofen, 20 types of tylenol, 50 types or cough medicine.. My Nib files could be crazy large amounts. This isn't what my application is about just trying to give you a idea. Any Help would be appreciated.
If possible, make common view controllers and reuse them. Just because the text on a given screen is different does not mean you need an entirely separate view controller to make that happen.
So had a question about my first real application i am working on. Say im looking to create a application where if i click on a button it brings up a table of , let's say medicines say 30.So say i click on Ibuprofen and it brings up a table of brands of Ibuprofen. Then once they click on that it brings up a new NIB file. describing the Ibuprofen brand and where its made ect...
Now my Question is....
How many Nib files is recommended in a application, say if i have a 100 or more is that bad? Would it be better off going towards a database? If someone could point me in the right direction it would be greatly appreciated.
My only concern is say i have 12 types of Ibuprofen, 20 types of tylenol, 50 types or cough medicine.. My Nib files could be crazy large amounts. This isn't what my application is about just trying to give you a idea. Any Help would be appreciated.
Generally, you don't do that kind of explosion of different nib files. Instead, think in terms of level (and type) of detail. If you have 3 levels of categories (e.g. medications, with categories for antibiotics, analgesics, dopamine blockers, selective serotonin reuptake inhibitors, whatever. Then, in antibiotics, you've got tetracyclines, penicillins, etc. Then, among those, you've got another sub-category, and finally, the brands of each individual med.
If you think through the types of information you need to display at each level, you might find that there are only 3 different presentation styles, where you've got a graphic, a heading and a sub-head in one, 2 columns of info and no graphic in another, etc.
Thus, you might actually only need 3 different nib files and unique view controller objects. When the user selects an item in a list, your code is written to invoke a particular view controller for that type of info. That view controller uses a specific nib file, and knows how to display it's data to that nib file. In one case, it might be top-level categories of meds, and then later, you might use another instance of the same view controller/nib to display the different families of antibiotics.
Having 100 nib-files isn't necessarily bad, but it means you're doing an awful lot of work, creating all those nib files, writing custom code for the view controller that manages each one, hooking up all the outlets and actions, etc, etc. It becomes a huge job, and a large, ponderous app.
Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.
Generally, you don't do that kind of explosion of different nib files. Instead, think in terms of level (and type) of detail. If you have 3 levels of categories (e.g. medications, with categories for antibiotics, analgesics, dopamine blockers, selective serotonin reuptake inhibitors, whatever. Then, in antibiotics, you've got tetracyclines, penicillins, etc. Then, among those, you've got another sub-category, and finally, the brands of each individual med.
If you think through the types of information you need to display at each level, you might find that there are only 3 different presentation styles, where you've got a graphic, a heading and a sub-head in one, 2 columns of info and no graphic in another, etc.
Thus, you might actually only need 3 different nib files and unique view controller objects. When the user selects an item in a list, your code is written to invoke a particular view controller for that type of info. That view controller uses a specific nib file, and knows how to display it's data to that nib file. In one case, it might be top-level categories of meds, and then later, you might use another instance of the same view controller/nib to display the different families of antibiotics.
Having 100 nib-files isn't necessarily bad, but it means you're doing an awful lot of work, creating all those nib files, writing custom code for the view controller that manages each one, hooking up all the outlets and actions, etc, etc. It becomes a huge job, and a large, ponderous app.
So where would i store the data at? So i should just do some research then on unique view controllers? Im currently reading Beginning Iphone Development, and Iphone Application Development. But they are for 2.0 so im kinda 2 versions behind but the code still seems to work. Do you have any reference sites that would be good to look over.
Well i have been reading and i still can't find quite what im looking for. I know the general lay out It opens up to a nib file showing pill bottles you click on one bottle and it comes up with a pickerview. Then that pickerview is linked to another picker view. But it seems like it may be easier to use a plist with multicomponent picker.
But then after that it would come up with some custom text in a scroll view. Im not sure how i would achieve linking the custom text with a picker, without creating a new nib file for each object on the multicomponent picker. Maybe some kind of dictionary file or data file. Which i can't seem to find any easy information on this.
Well i have been reading and i still can't find quite what im looking for. I know the general lay out It opens up to a nib file showing pill bottles you click on one bottle and it comes up with a pickerview. Then that pickerview is linked to another picker view. But it seems like it may be easier to use a plist with multicomponent picker.
But then after that it would come up with some custom text in a scroll view. Im not sure how i would achieve linking the custom text with a picker, without creating a new nib file for each object on the multicomponent picker. Maybe some kind of dictionary file or data file. Which i can't seem to find any easy information on this.
I personally use a database for the kind of app you're talking about. I'm new to Mac development, but I've been a Microsoft .Net developer for about 10 years now, and use databases for things such as that.
SQLite is a great little database that iPhone supports, there are plenty of tutorials online concerning how to work with it, such as:
Once you have your classes for handling the data then you can retrieve the data you need and populate your view objects based on what you retrieve.
That link I sent you should give you what you need, if you go through that example you'll see how the author uses SQLite to populate a UITableView, then when you click on one of the rows in the table view it takes you to the description.
I personally use a database for the kind of app you're talking about. I'm new to Mac development, but I've been a Microsoft .Net developer for about 10 years now, and use databases for things such as that.
SQLite is a great little database that iPhone supports, there are plenty of tutorials online concerning how to work with it, such as:
Once you have your classes for handling the data then you can retrieve the data you need and populate your view objects based on what you retrieve.
That link I sent you should give you what you need, if you go through that example you'll see how the author uses SQLite to populate a UITableView, then when you click on one of the rows in the table view it takes you to the description.
I hope that helps, and good luck!
Thank you this was very helpful almost exactly what i was looking for just going to have to figure out how to link it to a button to launch it and see if i can attach multiple pickers from it. But the tutorial was very good still learning though.
Is their a easier way to access and create SQL database files that you would recommend. Terminal seems a little tedious and easy to make a typo on esp if im typing multiple paragraphs.
Thank you this was very helpful almost exactly what i was looking for just going to have to figure out how to link it to a button to launch it and see if i can attach multiple pickers from it. But the tutorial was very good still learning though.
Is their a easier way to access and create SQL database files that you would recommend. Terminal seems a little tedious and easy to make a typo on esp if im typing multiple paragraphs.
Thanks a lot, that helps a ton.. I am using the firefox one to try out and see how it goes.. ill probably be posting here in the next few days when i run into my next brick wall when trying to pull data from the database into a multipicker on three different api's. Although i think i may only need one API that calls to different classes when a different button is touched to bring up that picker.