How to display transparent view to show the Upload successful message on current view and then go back to root view controller - iphone

In my current view controller i m uploading the content to server and i want to show the user that the upload was successful and then take him to the root view controller to perform another action.
Is there a way i can do it.
Thanks,

Check out MBProgressHUD

Related

Remove the current View Controller from the stack and move to a new View Controller

In my app the first time the user accesses a page it downloads the data for that section. The app sends the user to the download page the first time and after everything is downloaded it continues on the content.
I have a very roundabout way of doing it now using Userdefaults. Is there a nice way to dismiss the current view controller and segue to a new one at the same time.
The views are embedded in a navigation controller so ideally, I want to remove the download view controller from the stack as soon as it's finished downloading so if the user hits back, it goes back to the main menu rather than back to the download page.

Problems with my app's login

I have done a login for my app, so, to finish it, I modified the method didfinishlaunching from the delegate.
In this method, I take the session from the userdefaults and check if is valid(calling to my server). If it's correct, I load the main viewcontroller, if not, the login viewcontroller.
The problem is that in the method didfinishlaunching I dont load any viewcontroller, because I am waiting the response from the server. I load the viewcontrollers in the connection's delegate. This causes me 2 problems:
An error telling me I have to have one main view controller loaded
If I do, I put an viewcontroller, the time that I am waiting the response that viewcontroller is displayed, and it's very ugly.
I think that one solution may be to do another viewcontroller, only with a loading bar, and load it while I wait the response...
I did exactly what you are talking about in an app I've made: at the beginning I create a "SplashScreenViewController", that has an UIImageView equal to the image I use as a splashscreen for my app.
Here I have a loading wheel and I load every kind of data I need. When I receive every data I need, I load my root controller.
You can do the same, but you can load your controller relating to the session status.
I think you can show one of view controllers but add some overlay view with activity indicator, and when you get response just remove overlay and reload your view controller according to response.
while the nsmainthred is processing, create a new nsthred to create a view loading and add in subview from your view controller. When you get the response remove this view from super view
and depending your response, call your other view controller

how to insert UISplitView inside one my View Based application

I am working on an iPad application and need some help from you guys.
Actually i want to use UISplitView inside one my View Based application.
The flow of my app would be like following:
In main view:
When i Enter username and password and click Login, On Successfull login it should open the second screen using present model view controller.
Now on Second Screen there is a Button to goto Mails. When i click on it It should open up the 3rd screen. again pushed using presentModalViewController, which should have a UISplitViewController to show the emails list and when clicking on any email show the detail of that email.
Now please can any one guide me how can i use uisplitView controller inside the Viewbased application templet.
at least post any use full links/source code files.
Thanks in advance
The SplitViewController has to be the RootViewController. From Apple Docs:
"A split view controller must always be the root of any interface you create. In other words, you must always install the view from aUISplitViewController object as the root view of your application’s window. The panes of your split-view interface may then contain navigation controllers, tab bar controllers, or any other type of view controller you need to implement your interface."
So you cannot do what you want without writing your own container views (in iOS5) instead of using Apple' SplitViewController.

Load the root view when app enter into background in iPhone sdk

I am developing an application which has 4 views and use navigation controller to navigate through. The first view is login interface. I just want to display login view when user press home button from second view. I have tried to use popToRootViewControllerAnimated in applicationDidEnterBackground. This does not work. Because I need to do this job only user press home button from second view (Second view contains MKMapView).
Can you please let me know what is the best option for this job? Basically I just need to check what view I am currently on.
Many Thanks
You could log a BOOL variable that the viewDidAppear function on your second controller sets to YES. And when you leave that view set it to NO. In applicationDidEnterForeground check it. If it is YES then the user left while in the second view.

UIwebview delays loading

I have Login screen and second view which will be shown after login. On second view I have UIWebview which loads the url.
After login first it shows the empty view and slowly it loads the url. I want to show login screen with wait cursor, until the uiwebview loads the url and then want show that screen.
Can any body please provide code or sample for this?
Regards,
Malleswar
I cannot write your application for you, because it is a large project.
However, you might think about making your own login UIView as a child view of a UIViewController, which contains form elements:
This view controller is the root view controller in a UINavigationController stack.
The user enters her credentials into this form.
On clicking Submit, you push another UIViewController on to the navigation stack that contains a UIView child, that itself has a UIProgressIndicatorView and a UIWebView as children views.
The progress indicator view does its spinning wheel thing while the web page loads with the user's credentials entered in step 2.
Once the web page finishes loading, it fires its delegate method telling you loading has finished. This delegate method tells the progress indicator view to stop spinning and hide.
I would recommend reading up on UINavigationController through Google and Apple's ample documentation and sample projects. One sample project template is included in Xcode, as well.