strange things happen in my iPhone app. Since a not defined point in time when I start my navigation based app (it doesn't matter if in simulator or on the device) the last UIView (the one that the user reaches last) is shown on startup. After the app is loaded it switches automatically to the RootViewController's view. It's like the last view does the job of a splash screen.
I'm a little bit confused. Did somebody experience the same thing and maybe got the definite hint for a solution?
Thanks.
Ok, SOLVED: It's a pretty good idea to delete a "Default.png" with a screenshot of the last UIView from the Resource folder. No UIView was actually loaded, just the image.... damn it. what a stupid thing and as often, the problem was sitting in front of the screen.
Related
I am working on an App built with Xcode 4.1 and linked against iOS 4.0. Today I have started testing on iOS5 to get it ready by the time the new OS launches.
We have an interesting issue where almost every UIView subclass animates when they are redrawn. The views returned as section headers of a table view are animated every time the user scrolls for instance. But practically almost any UIView update is animated. The effect on the screen is very disorienting.
I can't find anything on this issue. But I must be missing out on some big changes or doing something very wrong.
Anybody experiencing similar issues?
Based on what I've seen of iOS 5 this isn't normal behavior.
It sounds like you are wrapping some call to that TableView inside of a UIView animation block, so any call the UITableView makes (Such as LayoutSubviews) is also in that animation block. Another possibility is that you forgot to properly commit an animation, so all UIView changes past that are also included.
There have been some changes to UIView animations and the way they are run. Just anecdotally, I've had some trouble with Animations that used to run sequentially running on top of each other. So, maybe this is a bug in your code that was just never noticeable before.
I´m doing an app for iPhone in objective-c, and before my app launches I want a splash screen to appear.
Thanks!
I think you are looking for Application Launch Images.
You just need to rename any image you want to "Default.png" and just add it in your project. That's all. Application will display that image while your app is loading.
As veredesmaralad answered, you can use an application launch image, but it's not really intended for use as a splash screen. It's intended to give the user immediate feedback that the app is launching, yet give the app some time to initialize. This image is displayed by the OS until your app puts its window on screen. The display time will vary from device to device.
If I were trying to do something more involved such as displaying the splash screen for a longer time, or animating the splash screen, I would display a view for the splash screen, then move on to the main app. I might just have my main UIViewController show the view, and then have an NSTimer tell the controller when to replace the view with the next view (e.g. the main user interface). For a more involved animated splash screen I might use a dedicated UIViewController to run that animation. Then when the animation completes I'd have the splash screen's controller load the next controller.
First off, this is called a "splash screen" and you may want to read up about it from somewhere like Wikipedia.
The answer to this question will depend heavily on what programming language you're using. If you could provide better explanation, a better answer can be given.
Simple question, hope there is a simple answer.
My scenario: iPhone app with NavigationController
Level 1: View with shouldAutoRotate..orientation=..Portrait (works)
Level 2: View with shouldAutoRotate..orientation=..Portrait (works)
When the iPhone is rotated, the views stay on portrait mode, perfect.
Level 3: View with shouldAutoRotate..TRUE (doesn't work on first load)
The first load of the view is in portrait independent of iPhone orientation and stays there, bad. After the view is ready, all rotations are recognized and work perfect.
Is there a way to tell the app "check your orientation now"? Several tricks I found didn't work (anymore) and the apple documentation seems less than helpful on this special topic.
So far the newest suggestion I found was to create a dummy view, show it and release it again, but I tried several places in the app and it didn't work. The view always gets stuck until you rotate the iphone manually. I would prefer a working example, so I can test it directly and see if it works before changing my code, but I'm also thankful for an explanation what to do if it works.
Thanks
//edit: As mentioned in one of the links this is considered a bug and not fixed by Apple, I worked around the problem replacing the NavigationController with own Controllers each with a Scrollview. Not very nice when you have all running and just need the rotation to work as expected, but works at least as expected. Thx to occulus for pointing in the right direction.
Please see this question:
Transitioning to landscape rotation within a uinavigationcontroller
Also:
UINavigationController and autorotation
So a good strategy might be to use Modal dialogs.
My iphone application has a user form under UIViewController.
When I out of application (go to background mode) and start application again some of my UIView changes its positions and sizes. (These UIViews depend on keyboard position)
Definately somewhere is my fault.
I try to figure what is going on when application starts again from background and where the UIView changes can be done.
May be you can suggest any links to read.
Thank you.
The UIViewController's viewDidLoad and viewWillAppear methods get called every time the view is dumped from memory, something that commonly happens when the app goes into the background. Depending on your code, it's possible that you're storing some position data that's not getting cleared. If that's the case, you can either:
Change your code to better fit the Model-View-Controller pattern so that the positioning code and variables are all in the controller, and you appropriately clean things up in its 'viewWillDisappearandviewDidUnload` methods (the better way), or
Clear out whatever remnants are hanging around in your application delegate's applicationWillEnterBackground method.
I have a simple tabbar app. Built directly from the tabbar template. As I test the app, I notice that the app sometimes crash. After pinpointing the right sequence, I found out that the app will crash if I do this:
Run app. Open the view that has a UIPickerView on it.
Open another view.
Tap home button (this will send the app to background).
Tap the app icon again to bring it at the front.
Tap the view that has the UIPickerView in it.
Crash!
Checking the console shows:
-[UIPickerView setFrame:]: invalid height value 130.0 pinned to 162.0
The UIPickerView I use is a custom size. I use transform of scale 0.8f on the height. So if you calculate 0.8*162.0 is indeed 129.9f (130 as mentioned by the console).
I have no idea how to fix this. Any ideas?
The problem is solved. It seems when the app goes to the background, UIPickerView needs to find its components resources again. It is not about sizing of UIPickerView at all.
I used images for the UIPickerView components, so after I populate the UIPickerView with these images, I released all the images that were allocated earlier. These images must not be released if it were to work in iOS4.
Only release them when the app ends.
Your problem has been fixed by another guy with a radical approach. See this post'sanswer provided by a guy named bhavinb.