TabBarController switch between Views [Switching to thread 12803] - objective-c

I've created an TabBarController with four Navigation Controllers. This functioned well, the application shows by start the first Navigation Controller, how it used to be.
But after that I created a UITableView (on the Third View Controller), the Application shows by start the Third View Controller for a moment and then it switch to the first view controller. And also the default.png Splash-Screen don't show up anymore.
How can I correct this? The Debugger Console shows the following message:
[Switching to thread 12803]
[Switching to thread 13571]
Thanks in advance for your help!

So I fixed the problem. I think there was some cache saved on the iPhone, so I restored en older Version of the application. After that it functioned well!

Related

Guided Access Mode implementation

I am running my app using base SDK 6.0 in XCode and then run the app in iOS 7.0(Device) after navigating to one or more screens then enable Guided Access Mode by pressing the home button thrice. Now the screen moves to MainViewController automatically and after that i am unable to navigate anywhere. The following Log can be seen in Console:Attempt to present a ViewController on another ViewController which is already presenting the ViewController.
Try putting this code in the - (void)viewDidAppear:(BOOL)animated method of your MainViewController.
[self.view.superview insertSubview:self.view atIndex:0];
Actually I was facing exactly same issue, as u described. And after research I found that, all the view hierarchy still exist in the memory, but mainViewController's view become the topmost view (Hiding others.). I do not have any logical explanation, why it is happening. I will post the details if I found any explanation.

Auto-layout mangles the segues in the iPad version

After a number of tests I found that a normal working iPad storyboard starts working weirdly upon introducing auto-layout. In particular it seems not to properly pop-up dismissed views by always recycling the same view controller and to also badly handle the queue of instantiated view controllers. When I disable auto-layout everything works fine again. Does anyone know if this bug is known to Apple or there is a fix?
Not been able to complement the question with new information, I posted a new one at:
Triggering segues from annotations

UIScrollView not functioning correctly after Modal view controller displayed in iOS 5.1

I have a strange problem when using a UIScrollView controller combined with iPhone 4 and iOS 5.1.
I have a UIScrollView which has a content size of 640x480 (double screen effectively) and in addition to the swipe to switch between the two "screens" I also permit the user to tap the screen in response to which I call something like...
[scrollView scrollRectToVisible:(CGRectMake 320,0,320,480) animated:YES];
the first 320 would be 0 if the tap occurred whilst the right hand side of the scroll view was displayed (note the scroll view has paging enabled so it can only come to rest either fully left or fully right).
I also have a situation where I sometimes display an additional view controller modally using presentModalViewController over this view controller containing the scroll view.
Everything works perfectly until the modal view controller is presented and subsequently dismissed after which the scrollRectToVisible method will no longer work if animated is set to YES (if I change animated to NO then it works as expected). Note, the tap is still being registered and the scrollRectToVisible being called, it just doesn't do anything when animated is set to YES).
Here's the kicker, this bug only occurs on an iPhone 4 runnings iOS 5.x.
It works perfectly (even after the modal view controller has been displayed) on my:
iPhone 3G running 4.x,
iPhone 3GS running 3.x,
iPod touch (2nd Gen) running 4.x
and most surprisingly the simulator running 5.x.
I wondered if this was a bug in the animation system so disabled the animation on the modal view controller presentation and dismiss and this had no effect, problem still occurred on the iPhone 4 with iOS 5.1.
Anyone got any ideas as to what might be causing this and how I might work around it?
Finally tracked this down. what a pig...
I'm embedding a view from a view controller as a subview of another view controllers view. So my scroll view contains a view which also has an associated view controller.
Prior to iOS 5.x the methods viewWillAppear, viewWillDisappear, viewDidAppear and viewWillDisappear are never called on the sub views view controllers, only the main view controller. Already knowing this I set up my main view controller to manually call the sub views view controllers methods when these events happen.
However it appears that in iOS 5.x this issue has been "fixed" so where I was manually passing the call to viewWillAppear to my sub view controller I no longer need do this under 5.x as the method automatically gets called under 5.x - as a result it's now being called twice under 5.x but still only once when running on a 4.x or earlier device.
As a result, under 5.x my NSTimer used to call my updateUI method is being created twice, but because in viewDidDisappear I only destroy the timer if it is non nil it only gets destroyed once - therefore I'm leaking NSTimers under 5.x through double allocation where I'm not under 4.x.
As a result of multiple NSTimers hanging around all repeatedly calling my updateUI method is that the constant updating of the UI is killing the animation system and so the animation for the scrollView fails when running on an actual device. I guess it continued working OK on the simulator running 5.x as the CPU in the Mac is more than capable of handling the extra workload and still performing the animations correctly.
A simple check in my viewWillAppear method to ensure the NSTimer hasn't already been created has fixed the problem and has kept compatibility with 4.x and earlier.
I frustratingly run up against these kinds of issues every time Apple update their iOS by major versions... The morale of this story is don't assume that long standing classes still exhibit the same behaviour under different revisions of the OS.
I had the same problem. I realized that after modalViewController is dismissed my UIScrollerView shifts downs by 20px, which is the same height as status bar. So, it means when my UIViewController is loaded and UIScrollView is created, UIScrollView thinks there is no status bar, when actually it is there.
So I tried to put in viewDidLoad:
[[UIApplication sharedApplication] setStatusBarHidden:NO];
Now my UIScrollView always stays under status bar, with Y position 20px. It never shifts down.
I finally managed to get this working on an iPhone4 running 5.1. Ensuring the bounces horizontally property for the scroll view is set fixed the problem, though why having this unchecked should cause the problem in the first place is beyond me - I'm pretty certain this is a bug in iOS.

MonoTouch: StoryBoarding - manual segues?

iPhone/iPad dev newb here...
I am using MonoTouch to create a universal iPad/iPhone storyboard app. In the primary view controller (RootViewController) the default auto-generated behavior is a table with a single cell "Detail" in it, which hardwires you to the next destination (DetailViewController).
I'd like to change this RootViewController to instead show a login control I've made extending UIViewController (LoginView). I have had some success putting the LoginView inside the RootViewController, but can't figure out how to make it 'segue' to DetailViewController. And upon watching how the iPad app works, where there is no segue (that I can see) between the two, am I going about this wrong?
To summarize: How do I enhance this storyboard app with a preceding login screen, reusing its contents/xib between the iPad and iPhone variant?
Apologies if this is a bit unclear and muddled.......
I have not tried a storyboard app in Monotouch yet, but I did spend a lot of time working out the best approach for a login screen for my application. What I ended up doing, which could work in your situation as well, is presenting the login screen as a Modal view. Once the user has successfully logged in, we then push the next appropriate view.
So if you are automatically pushed into the detail view by the storyboard viewcontroller, you could display the login dialog as a modal dialog from the detail view's DidLoad or DidAppear methods.

How to add a Navigation Controller to the MainWindow for iPad in Universal Application

I tried to add a NavigationController to the MainWindow_iPad of the Universal Application. placed the Navigation Controller using XIB,
Created a New ViewController (MainViewController)
Created instance in the App Delegate , Referenced the Outlet.I changed the field to pop the MainViewController . Bt its not loading properly .The MainWindows loads and it doesnot loads the NavigationController.
I have another problem too . I changed my Project Name for some reason.When I try to launch the application , It launches ,but "applicationDidFinishLaunching" is not invoked.
Whether I missed any configurations ?
First of all, these should probably be two different questions. For the first, in applicationDidFinishLaunching, are you adding the UINavigationController's view to the mainWindow (posting the code of applicationDidFinishLaunching would help) ? For the second question, the MainWindow nib gets launched (either iPad or iPhone). This sets in motion the loading of your application delegate. Did you change the info.plist so that another nib is loaded?