I hope you can help me with my actual problems with designing an iPhone-App in the latest xCode version.
Here´s what I find a bit strange:
I designed a new project with a Storyboard and a Navigation Controller. Then I placed Objects like UILabels, ImageViews and so on. No when I run the Project in the simulator (as well on the iPhone) I noticed the following: When the App loads all the in the View placed objects fall down from the top to take their defined place. It takes maybe the quarter of a second, but its clearly to see. It also happens on all other views initiated from the root view controller
So, what do I have to change that everything is at it´s fixed place without to fall down from the top at the start of the app?
I hope I described it good enough. Actually I have no idea what´s going on there. I hope you can help me to fix this "problem". I´ve written some small Apps before, but I´ve never noticed a behavior like this.
Got the solution: I´ve had to remove the animations on the main view... now it works proper! :-)
Related
Consider the above's IB objects listing. Siblings further down the list should be on top of the siblings listed further up when rendered on the screen.
Under Xcode 4.5.2, everything is ok if iphone simulator 5.1 is used. But for simulator 6.0 the map just covers everything. The same if using actual devices (phones) for testing.
Hope that somebody knowledgeable could help.
Please also add comments if you do not (or do) find such a problem on simulator 6.0. Chances are the problem is related to how my project is setup.
Update :
Have setup a new test project with iOS 6 map view myself. There seems to be no problem with z-order at all. So the problem could relate to my code. Unfortunately, quite a lot have already been written, there wouldn't be enough time to go over everything for the time being. I suspect that it has something to do with the rootViewController property. My project initially followed a older scheme in which rootViewController was not used ...
I dont know if that order is reliable at all -- in the past definitly not and I am not conviced it is today :D. (even though apple claims it :D)
see: IPhone Interface Builder: Z-Index, Z-order of a button, image, ui element, etc?
(the 3rd answer currently. 7 votes)
The problem is solved by calling Window's bringSubviewToFront method. But I believe a better and more proper solution can be found given enough time.
This is so weird. I have been working on a series of iterations of the same application for almost 2 months, have not touched the code related to the view management in weeks, and this bug just appeared.
Basically I am at the root level view, i go to the last view in the stack by way of a "skip" type button. This page is used for settings. I then change some things (not related to the view hierarchy) and save, which takes me back to root. Then i try going to the first view in the stack.
Initially all of the textfields for the view are visible, but their uilabels are not. The view then slowly drifts to the right, revealing the same view with labels intact directly under it. I have never seen a bug like this before in over 2 years of iOS dev, so here I am.
The only code I have changed in the last week is related to web services and threading, nothing having to do with the view hierarchy.
If anyone has seen this bug before please help! Probably important as well, I have not seen this happen on the simulator, only on the actual device (iPad running 4.3.3)
Thanks!
Threading is the most likely culprit: making UI calls anywhere other than the main thread can cause any number of strange problems. Make sure anything you do to the UI, even a -popViewControllerAnimated:, is wrapped in a -performSelectorOnMainThread:withObject:waitUntilDone: or an appropriate dispatch_async(dispatch_get_main_queue(), ^{...}) call.
I'm sure there's a simple answer to this but it's beginning to annoy me now!
I have an iAd integrated into my app which appears and works on the screen I've implemented it in. The app uses a NavigationController to move between multiple screens, but the iAd is only on one of them. After moving from start to finish through my app several times I get a message appear in GDB saying:
Too many active banners (11). Creation of new banners will be throttled.
The app then crashes.
I have tried looking through the Apple documentation and searched on Google and can't see a solution to the problem.
If anyone has any idea how I can resolve the issue it would definitely stop me from going mad! Thanks.
It sounds like you're not removing your iAds when views hide. I suggest doing the creation in viewWillAppeaer and removing ads in the viewDidDisappear method. Like this, you'l only end up with as many banners as you create in the visible view. It sounds like you're using the viewdidLoad/viewWillUnload pair instead.
Another alternative is to create the ADBannerView in a fixed location across all screens. It's a little bit harder than the above method, but it looks nice. For example, if you have a tab bar controller application, you can do the following in your app delegate:
[self.myTabBarController.view addSubview:self.myAdView];
It can get a little bit tricky to place other views underneath the ad.
I have different view controllers and i linked them using insertsubview
There are atleast three levels of subviews for every screen the users sees.
I havent tested it on device yet.
I want to know whether this causes any performance issues
Also, is using NavigationBarController pop and push views better than addsubview and remove from super view.
(I dont want the back functionality of NavigationBarController and want a custom header. That is why i didnt use NavigationBarController)
This is an interesting statement :
I haven't tested it on device yet.
My advice is simple :
Test it on a device.
Only you know what your app does - you can't possibly think we can answer your question with so little information! 3 doesn't seem a very big number but I don't know what each of those views is doing so maybe it's an issue, maybe not.
I'm trying to get started with an iPhone application, I had a look around at other questions but i'm still sorta stuck so hopefully someone can help...
First thing is I'm totally confused with the whole view concept, I'm more used to visual studio so I'm going to use the term 'form' to describe what I have in my head.
I want to achieve a home screen in an application with say 9 icons (much like the iphone home screen) which each lead to a different 'form'. Each form may have a different function so say one might be a simple calculator, one might play a video etc.
How do I do this, its destroying my soul trying to do something so simple... If you guys even have any links to get me on the right track it would be greatly appreciated
I suggest you take a look at the Stanford iPhone Programming Course. If you don't have the time to look through it all, I reccommend at least Lectures 5 and 6 about Views and ViewControllers. The slides are quite instructive and they come with video presentations that should help you get on your way in about an hour.
Apple's samples are a great place to start. There are some simple ones that can show you how views and view controllers work.
Also, in Xcode, when you create a new iPhone app template, that template usually has enough code to display a view, and sometimes a flip-side view or more. Sometimes, you should stop reading, and do.
I had the same weird learning curve as you, as things don't initially seem to make sense but they do - and once you've got your head round them they make perfect sense trust me!
Your 'forms' are viewControllers in this M-V-C land, they control all the 'view' (which are controls or any object which can be seen) within them. Normally they are loaded from a Nib (design from the interface builder), but don't have to be.
The way I would go about your problem is to use a navigationController as the base to handle all of your view controllers.
A navigation controller needs a rootviewcontroller to start so this will be your desktop Viewcontroller. I'm not sure how you are planning to populate this but all the icons will need to be stored in some kind of array. I suggest you use a simple UIButton. When then button is pressed you then alloc and init and push the required view controller.