Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 07-06-2010, 09:29 PM   #1 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 6
Ice9 is on a distinguished road
Default Basic App questions.

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.
Ice9 is offline   Reply With Quote
Old 07-06-2010, 09:47 PM   #2 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

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.
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 07-06-2010, 09:53 PM   #3 (permalink)
Cocoa Junkie
 
Duncan C's Avatar
 
Join Date: Dec 2008
Location: Northern Virginia
Posts: 6,003
Duncan C has a spectacular aura about
Default

Quote:
Originally Posted by Ice9 View Post
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.
__________________
Regards,

Duncan C
WareTo

Check out our apps in the Apple App store


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.

See this tutorial on using UIView animations and layer animations:

See this thread on generating random, non-repeating text

Check out a very cool Macintosh Kaleidoscopes app called ScopeWorks that we released to the Mac App store.
Duncan C is offline   Reply With Quote
Old 07-06-2010, 10:20 PM   #4 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 6
Ice9 is on a distinguished road
Default

Quote:
Originally Posted by Duncan C View Post
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.
Ice9 is offline   Reply With Quote
Old 07-06-2010, 10:24 PM   #5 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

Keep reading the book. You'll find your answer.
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 07-07-2010, 12:53 PM   #6 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 6
Ice9 is on a distinguished road
Default

Quote:
Originally Posted by BrianSlick View Post
Keep reading the book. You'll find your answer.
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.
Ice9 is offline   Reply With Quote
Old 07-07-2010, 01:48 PM   #7 (permalink)
Registered Member
 
Join Date: Jul 2010
Location: Michigan, USA
Posts: 6
bighugedave is on a distinguished road
Default Use a database

Quote:
Originally Posted by Ice9 View Post
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:

iPhone SDK Tutorial: Reading data from a SQLite Database | dBlog.com.au

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!
bighugedave is offline   Reply With Quote
Old 07-07-2010, 03:05 PM   #8 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

The president example in Beginning iPhone Development is almost exactly what you need.
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 07-07-2010, 05:56 PM   #9 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 6
Ice9 is on a distinguished road
Default

Quote:
Originally Posted by bighugedave View Post
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:

iPhone SDK Tutorial: Reading data from a SQLite Database | dBlog.com.au

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.
Ice9 is offline   Reply With Quote
Old 07-07-2010, 06:21 PM   #10 (permalink)
Registered Member
 
Join Date: Jul 2010
Location: Michigan, USA
Posts: 6
bighugedave is on a distinguished road
Default

Quote:
Originally Posted by Ice9 View Post
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.
There are some free ide's for sqlite, such as the free firefox addin: sqlite-manager - Project Hosting on Google Code

There's a lot more but some are pais apps, a good paid one is Razorsql. You can administer many types of databases with RazorSql.

I don't hardly ever administer databases without an ide, it's so much easier with an ide.
bighugedave is offline   Reply With Quote
Old 07-07-2010, 06:25 PM   #11 (permalink)
Registered Member
 
Join Date: Jul 2010
Location: Michigan, USA
Posts: 6
bighugedave is on a distinguished road
Default

Here's a list on the Sqlite site of Ide's, too.


SQLite CVSTrac
bighugedave is offline   Reply With Quote
Old 07-08-2010, 06:43 AM   #12 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 6
Ice9 is on a distinguished road
Default

Quote:
Originally Posted by bighugedave View Post
Here's a list on the Sqlite site of Ide's, too.


SQLite CVSTrac
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.
Ice9 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 335
9 members and 326 guests
anothermine, Chickenrig, firecall, givensur, iNet, michaelhansen, Objective Zero, PixelInteractive, stanny
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,657
Threads: 94,118
Posts: 402,892
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jenniead38
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 12:29 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0