Discussion in 'iOS Programming' started by emf0401, Dec 14, 2011.
In my app I'm using a tab bar, scroll view,images, and a couple more things.
If I want to use the tab bar do I have to make a tab bar application? because when if i do it then when I try to use the scroll view, for example, it doesn't work. Or could I use a view-based application? I also tried that and when I use the simulator it doesn't show the tab bar.
Tab-bar application should be fine. What do you mean the scroll-view "doesn't work"?
The templates are only helpful starting points. You can use any feature you'd like regardless of which template you start with.
Scrollviews only work if you set its contentsize larger then the size you putted it in the interface builder just some things you should remember!
About the tabbar, you can start any application with blank, and just add what you want, it's a matter of learning how to do it, they provide you with some basics, to get started faster, in other words, whatever floats your boat.
I also tried adding the code, and when I run the app with the simulator there's no scroll view. I learnt how to write the code for view based applecation, so I don't know if the code there is different.
Okay, sorry but i'm new and I don't know a lot of thing.
I'm right now in school so I will try to answer everything later.
Since you're new here, I'm gonna suggest you read these two blog posts: Getting Answers and What have you tried?
Besides what larswik and demo have already said, it would help us to know something about your background. What programming (if any) did you do before starting with Xcode last month?
I know a little bit of html and php and also I read this book.
Okay so I did the scroll view like I did in a View based application.
And it worked in view based. The thing is that I don't know if I have to put it different when I'm using a tab bar application.
Your UIScrollView is never set, and since it's not an IBoutlet, you will need to code it first, it doesn't know where to set it's frame, what pointer instance it is. etc..
So what do I have to do? And was it working in the view based application?
You need to alloc init your scrollview, with a frame, so it knows where to actually set it to your screen.
OR you make it an IBOutlet and put it in the XIB..
If you have no idea what i'm talking about, maybe check some iphone tutorials on how to program for iPhone.
But I did making the IBOutlet right? I don't understand the first way, could you explain it to me?
No. You reserved space for a variable that holds a pointer to a UIScrollView. This does not create an instance. I think you need to take about 10 steps back and learn the fundamentals of C (yes C, not Objective-C).
emf0401 , are you saying you created a view-based app, added the ivar and property for a UIScrollView and suddenly it appeared in your app? If so, I would love to see how you performed this miracle. Can you zip up your project and attach it to a post?
Okay that's what I did in the view based app that i said before.
I guess you forgot the part where you dragged a Scroll View into scrollerViewController.xib, since there is one in there and it wasn't automatic. So, you just do the same in whatever viewController.xib you want it to be in for your tabbed application.
Oh sorry I forgot that but the thing is that I couldn't drag it from the nib file in the tab bar app.
do I have to create two controller.h and .m files for each tab?
How did you create your tab-bar application? Using the Tabbed Application template?
Better yet, instead of all the back and forth, I think you should just explain all the steps and settings you used to create your tabbed application.
Okay so it is not storyboarded, I just started a tab bar app template.
But anyway I just started a new one to try again and it worked, I must did something wrong. So thank you very much!
But I still having the questions about creating the files for each tab.