Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

emf0401

macrumors newbie
Original poster
Dec 14, 2011
16
0
Hi, I started programming with xcode one month ago, and I'm making my first app and I have some problems...

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.

Sorry if it is something stupid, but i'm new in all this and I try searching in google but i didn't find anything. Also sorry for my english I'm spanish :)
Thanks, Emilio.
 

admanimal

macrumors 68040
Apr 22, 2005
3,531
2
The templates are only helpful starting points. You can use any feature you'd like regardless of which template you start with.
 

jnoxx

macrumors 65816
Dec 29, 2010
1,343
0
Aartselaar // Antwerp // Belgium
Tab-bar application should be fine. What do you mean the scroll-view "doesn't work"?

Double that.
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.
 

emf0401

macrumors newbie
Original poster
Dec 14, 2011
16
0
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.
Thank you for the answers
 

emf0401

macrumors newbie
Original poster
Dec 14, 2011
16
0
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. :)
 

larswik

macrumors 68000
Sep 8, 2006
1,552
11
If you are totally new to programming like I was 18 months ago. I recommend that you first learn to program and understand it. If you get totally lost making an app and you are searching for that youtube video to give you the parts you need, you are not learning. Programming is hard and takes time. So if you struggle start with the basics first like I did. I spent over a year before I made my first GUI

http://www.amazon.com/Learn-C-Mac-Dave-Mark/dp/1430218096
 

balamw

Moderator emeritus
Aug 16, 2005
19,366
979
New England
Hi, I started programming with xcode one month ago, and I'm making my first app and I have some problems...

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?

B
 

emf0401

macrumors newbie
Original poster
Dec 14, 2011
16
0
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?

B
I know a little bit of html and php and also I read this book.
http://img2.imagesbn.com/images/103180000/103189658.jpg

----------

there's no scroll view, how do you know, what did you try, how did you try to debug to what's going on. so many unanswered questions ;)

Okay so I did the scroll view like I did in a View based application.
I type in the controller.h

Code:
@interface FirstViewController : UIViewController{


    UIScrollView *scroller;
}

@property (nonatomic, retain) IBOutlet UIScrollView *scroller;

And in the controller.m

Code:
@synthesize scroller;

- (void)viewDidLoad
{
    [scroller setScrollEnabled:YES];
    [scroller setContentSize:CGSizeMake(320, 1000)];
    [super viewDidLoad];
}


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.
Then I don't know how to debug...
 

emf0401

macrumors newbie
Original poster
Dec 14, 2011
16
0
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?
 

jnoxx

macrumors 65816
Dec 29, 2010
1,343
0
Aartselaar // Antwerp // Belgium
YOu can make a ScrollView anytime ;)
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.
 

emf0401

macrumors newbie
Original poster
Dec 14, 2011
16
0
YOu can make a ScrollView anytime ;)
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?;)
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
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).
 

jnoxx

macrumors 65816
Dec 29, 2010
1,343
0
Aartselaar // Antwerp // Belgium
Like Robbie said, but he can explain it better then me, you have a property and an ivar, there is a difference, and you should definitly take a step back, and actually know what your jotting down in code, or you will bump your head alot more then you intend to ;)
 

dejo

Moderator emeritus
Sep 2, 2004
15,982
452
The Centennial State
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?
 

emf0401

macrumors newbie
Original poster
Dec 14, 2011
16
0
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.
 

Attachments

  • scroller.zip
    61.5 KB · Views: 42

dejo

Moderator emeritus
Sep 2, 2004
15,982
452
The Centennial State
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.
 
Last edited:

emf0401

macrumors newbie
Original poster
Dec 14, 2011
16
0
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 :confused: 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?
 

dejo

Moderator emeritus
Sep 2, 2004
15,982
452
The Centennial State
Is your project storyboarded?

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.
 

emf0401

macrumors newbie
Original poster
Dec 14, 2011
16
0
Is your project storyboarded?

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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.