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 09-22-2011, 01:10 PM   #1 (permalink)
Registered Member
 
Join Date: Sep 2011
Posts: 4
s0krates is on a distinguished road
Default UI Architecture Problem...

Hi all,

I need to develop small iPhone application and I have no experience with iPhone SDK and Objective-C.

However I already developed the code-behind and all the logic of the app.
The only problem is that I can't build the UI.

When the app will run for a first time,Login screen will appear,with some text boxes and button login(but only the first time the application runs).
When user press the login button I save the info user provided and navigate to view with tabs.
That's all I need.

One view without tabs that will be displayed only once and another view with tabs.

The problem is that I'm not familiar with iPhone views so if some one can explain me in few words it will be great!

P.S. : I'm an Android developer
Thanks!!!
s0krates is offline   Reply With Quote
Old 09-22-2011, 01:17 PM   #2 (permalink)
Knows SQL
 
iisword's Avatar
 
Join Date: Oct 2009
Location: Somewhere the streets are on fire, the sewers are flooded, and the cats are high on catnip
Posts: 529
iisword is on a distinguished road
Default

Suggest you read Beginning iPhone 4 Development .

As for your question, the interface builder will make building it much easier. Start with this link: Loading…
__________________
iisword is offline   Reply With Quote
Old 09-22-2011, 01:23 PM   #3 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 194
mavrik5150 is on a distinguished road
Default

The simple approach is to start out using the TabBar template in Xcode which will give you the Tab Views you are looking for. Then for the login screen you just need to add an additional view controller to your app for the login page, and have the AppDelegate call that screen up from the didFinishLaunching method to have that view presented as a Modal view in front of the TabBar view. Then you just need to have a flag in place, easiest is within NSUserDefaults to catch if it's the first time the app has been ran to show that screen and if not then just load the app as normal.

I've done this on a couple apps and it works fine, if you need some further explanation let me know where you get stuck at and I'll see if I can help.
mavrik5150 is offline   Reply With Quote
Old 09-22-2011, 01:27 PM   #4 (permalink)
Registered Member
 
Join Date: Sep 2011
Posts: 4
s0krates is on a distinguished road
Thumbs up

Quote:
Originally Posted by mavrik5150 View Post
The simple approach is to start out using the TabBar template in Xcode which will give you the Tab Views you are looking for. Then for the login screen you just need to add an additional view controller to your app for the login page, and have the AppDelegate call that screen up from the didFinishLaunching method to have that view presented as a Modal view in front of the TabBar view. Then you just need to have a flag in place, easiest is within NSUserDefaults to catch if it's the first time the app has been ran to show that screen and if not then just load the app as normal.

I've done this on a couple apps and it works fine, if you need some further explanation let me know where you get stuck at and I'll see if I can help.
Thx for the answer!
Can you please share some code example of the didFinishLaunching method that will present the Login view in front of the TabBar View?
Can I make it fullscreen?Because I don't want to see the tabs..
s0krates is offline   Reply With Quote
Old 09-22-2011, 01:40 PM   #5 (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 s0krates View Post
Hi all,

I need to develop small iPhone application and I have no experience with iPhone SDK and Objective-C.

However I already developed the code-behind and all the logic of the app.
The only problem is that I can't build the UI.

When the app will run for a first time,Login screen will appear,with some text boxes and button login(but only the first time the application runs).
When user press the login button I save the info user provided and navigate to view with tabs.
That's all I need.

One view without tabs that will be displayed only once and another view with tabs.

The problem is that I'm not familiar with iPhone views so if some one can explain me in few words it will be great!

P.S. : I'm an Android developer
Thanks!!!
What language is your existing code written in? If it's in C or C++ you should be able to use it pretty much as-is, with Objective C code to handle the application details.

iOS supports what Apple calls Objective C++, which is combined Objective C and C++ classes in the same modules. Both are clean supersets of C, so C is equally portable.

You're going to need to learn the basics of Objective C 2.0. You might want to buy a book on Objective C for programmers.


You should learn about Cocoa memory management. If you've been doing Android Java, having to track object ownership and release objects when you are done with them will be an adjustment.

If you don't have a background in C or C++ you should also study C pointers, as Objective C uses C pointers to refer to it's objects.

I suggest reading the "Memory Management Programming Guide" in the Xcode documentation.

You also need to learn about the Model-View-Controller design pattern, and specifically how it's used in iOS applications.

Then you'll need to be at least somewhat familiar with the Cocoa touch application framework and the classes every program needs to use.

I would suggest learning about view controllers, and handling low memory conditions. (Take a look at the UIViewController Class reference, again in the Xcode documentation)

Read up on Navigation Controllers (The UINavigationController Class Reference in Xcode is a good introduction.)

You'll also need to learn about a few key Cocoa classes like NSString, NSArray, NSDictionary, and possibly NSUserDefaults, NSURL, and NSFileManager. You'll probably also need to learn about file bundles and how to configure the settings in your application bundle. (Read up on NSBundle and info.plist.)

The Xcode IDE will also take some getting used to. You'll need to learn how to create user interface files (also known as "Nib files" or ".xib" files)
__________________
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 09-22-2011, 01:43 PM   #6 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 194
mavrik5150 is on a distinguished road
Default

So below is the code from the App Delegate that will show a LoginScreen, and because it's being presented as Modal view it will cover the Tabs of the Tab Bar app. In this code below this LoginScreen will only show up on the first run, since I'm adding a flag that will checked from the UserDefaults to see if this is the first time. I don't update the flag until the Save button is pressed from the SetupScreen since if the user decides to close the app without saving I don't want the next run to bypass this screen.

Here's the code from the App Delegate:
Code:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    
    self.window.rootViewController = self.tabBarController;
    [self.window makeKeyAndVisible];
    
    //Check if this is the first time the App launched and if so pull up Setting Screen
    BOOL firstTime = [[NSUserDefaults standardUserDefaults] boolForKey:@"keyFirstTimeCheck"];
    if (!firstTime)  {
        SetupScreen *settings = [[SetupScreen alloc] initWithNibName:@"SetupScreen" bundle:nil];
        //Add Navigation Controller to Setup Screen for Transistion Effects
        UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:settings];
        [self.tabBarController presentModalViewController:nav animated:YES];
        [settings release];
        [nav release];
    }
    
    
    return YES;
}

-(void) removeInitialScreen { 
    //Dismiss Initial Settings Screen and show Tab Bar App
    [self.tabBarController dismissModalViewControllerAnimated:YES];
    
}
The second method (removeInitialScreen) is called from the SetupScreen as well after the save button to remove the SetupScreen from the view. Also, if you don't want the SetupScreen to slide into view change the animated to NO and then when the app is launched the SetupScreen would be the first view seen without an animation effect.

From your Setupscreen you would have a method somewhere for saving whatever data you want but at the end you will want to set the BOOL flag for the firstcheck key to YES and then call the app delegate to run the remove modal screen method as well using :

Code:
ThisAppDelegate *del = (ThisAppDelegate *)[[UIApplication sharedApplication] delegate];
        [del removeInitialScreen];
mavrik5150 is offline   Reply With Quote
Old 09-22-2011, 01:45 PM   #7 (permalink)
Registered Member
 
Join Date: Sep 2011
Posts: 4
s0krates is on a distinguished road
Thumbs up

Thx,but I already know the basics of Objective-C and memory issues.
And as I said I already developed the app logic (calling web service that written in asp.net by me) and I'm handling UI Events.

I just can't handle how to display the screens...

Thanks!
s0krates is offline   Reply With Quote
Old 09-22-2011, 02:29 PM   #8 (permalink)
Registered Member
 
Join Date: Sep 2011
Posts: 4
s0krates is on a distinguished road
Arrow

Quote:
Originally Posted by mavrik5150 View Post
So below is the code from the App Delegate that will show a LoginScreen, and because it's being presented as Modal view it will cover the Tabs of the Tab Bar app. In this code below this LoginScreen will only show up on the first run, since I'm adding a flag that will checked from the UserDefaults to see if this is the first time. I don't update the flag until the Save button is pressed from the SetupScreen since if the user decides to close the app without saving I don't want the next run to bypass this screen.

Here's the code from the App Delegate:
Code:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    
    self.window.rootViewController = self.tabBarController;
    [self.window makeKeyAndVisible];
    
    //Check if this is the first time the App launched and if so pull up Setting Screen
    BOOL firstTime = [[NSUserDefaults standardUserDefaults] boolForKey:@"keyFirstTimeCheck"];
    if (!firstTime)  {
        SetupScreen *settings = [[SetupScreen alloc] initWithNibName:@"SetupScreen" bundle:nil];
        //Add Navigation Controller to Setup Screen for Transistion Effects
        UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:settings];
        [self.tabBarController presentModalViewController:nav animated:YES];
        [settings release];
        [nav release];
    }
    
    
    return YES;
}

-(void) removeInitialScreen { 
    //Dismiss Initial Settings Screen and show Tab Bar App
    [self.tabBarController dismissModalViewControllerAnimated:YES];
    
}
The second method (removeInitialScreen) is called from the SetupScreen as well after the save button to remove the SetupScreen from the view. Also, if you don't want the SetupScreen to slide into view change the animated to NO and then when the app is launched the SetupScreen would be the first view seen without an animation effect.

From your Setupscreen you would have a method somewhere for saving whatever data you want but at the end you will want to set the BOOL flag for the firstcheck key to YES and then call the app delegate to run the remove modal screen method as well using :

Code:
ThisAppDelegate *del = (ThisAppDelegate *)[[UIApplication sharedApplication] delegate];
        [del removeInitialScreen];
Thx work like a charm!
I get some warnings but I will try to handle them by my self!!!
s0krates is offline   Reply With Quote
Old 09-22-2011, 06:39 PM   #9 (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 s0krates View Post
Thx,but I already know the basics of Objective-C and memory issues.
And as I said I already developed the app logic (calling web service that written in asp.net by me) and I'm handling UI Events.

I just can't handle how to display the screens...

Thanks!

Sorry, I misunderstood your level of knowledge.

mavrik5150 outlined a reasonable approach.
__________________
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
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: 394
14 members and 380 guests
7twenty7, eski, EvilElf, HemiMG, iOS.Lover, jarv, n00b, pbart, Pudding, sacha1996, Sami Gh, UMAD, VinceYuan, yuncarl28
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,672
Threads: 94,121
Posts: 402,905
Top Poster: BrianSlick (7,990)
Welcome to our newest member, yuncarl28
Powered by vBadvanced CMPS v3.1.0

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