Guided Access Mode implementation - objective-c

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.

Related

UIKeyboardWillShowNotification - iOS8 vs iOS7

With iOS8, I noticed that a view controller was no longer receiving a UIKeyboardWillSHowNotification, when it previously was with iOS7.
Here's the scenario:
1.) View Controller A is displaying a keyboard, and pushes View Controller B without resigning first responder
2.) View Controller B has a control that becomes first responder during its viewDidLoad call, while it's being created by VCA, before it's pushed onto the nav controller
3.) If VC A is NOT displaying a keyboard when pushing B, the notifications work fine. However, if A is still editing when pushing B, then B does not get a keyboard will show notification.
Without the keyboard notification, VC B is not resizing / repositioning and does not look right.
The workaround I'm using until I find a solution is to do the following from any view controllers that might be editing when pushing another view controller that might be editing:
i.e., before pushing another view controller, be sure to call:
[self.view endEditing:YES];
While it works, it doesn't seem good that the view controller (B) can be 'broken' by the state of the app prior to displaying it.
Question: Am I doing something wrong here?
As far as I can tell, one of 3 things are possible:
A.) I should be getting the notifications, but I'm not b/c I'm doing something wrong
B.) I should be getting the notifications, but I'm not b/c of a bug
C.) I can't rely on always getting the notifications...But if I don't get the notifications in VC B when it appears, I need to be able to get the keyboard dimensions of the displayed keyboard without relying on the keyboard notification info. All the apple docs say to use the notifications though (as far as I can find).... which points back to options A.) or B.).
I can create and upload sample code later tonight / early tomorrow to try and isolate / for you all to test/reproduce to see what I'm doing.
I can see the same issue with iOS8 / xCode6 (works with iOS7 and xCode5). In my case, I'm observing a systemStatus property on the model in my AppDelegate so as to log the user out and bring the user back to the login screen when the user logs out from anywhere in the app. I'm doing that by setting the window.rootViewController to the loginViewController in my App Delegate observeValueForKeyPath: method.
This works fine on iOS7 / xCode5 but on iOS8 / xCode6, I loose the keyboard in the way. Looks like my loginViewController might be registering for keyboard notifications (in its ViewWillAppear method) before the window's rootViewController switch is complete (in iOS8) thus registering to the old window's notification center...
I moved the registration for keyboard notifications to the ViewDidAppear: method instead and that seems to fix it but somehow this seems to be called twice for some reason.

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.

Xcode 4.2 iOS5 Storyboard reference is nil while trying to implement Page View Controller

While trying to implement the Default Page Based app in another Single View application, I tried everything, but self.storyboard in the class that extends UIViewController is always nil.
Is there any tutorial I can follow?
Storyboard has the following: Login Screen (UIViewController) -> UITabBarController -> UITableViewController; on didSelectCell… I added 2 UIPageViewController that are identical to the ones in the page passed to the app, and the ModelController.h/m and did all the alterations needed to my knowledge.
self.storyboard in the RootViewController.m is always nil, and it ends up crashing my app.
P.S. I am a beginner, and I don't know how to get a reference of the storyboard object from my ViewController.m/h to the RootViewController.m/h.
I'm not too sure what you are trying to get at, but just use this project http://www.wannabegeek.com/?p=168
at the bottom of the page there is a github link which will allow you to download the whole project, no coding necessary.
and here's the github link just incase you couldn't see it
https://github.com/wannabegeek/PageViewController

Present modal view controller on top of Quick Look PreviewController results in checkerboard-screen?

Situation: my app needs to present a full screen modal view whenever it becomes active (from background) to ask the user for a PIN. All fine.
Unless: if the user previews a file using QLPreviewController, leaves the app and comes back, the PIN input controller will be presented modally from the QLPreviewController which I'm keeping a reference to. The PIN input is shown but when it dismisses, I see a checkerboard-styled background which is even scrollable. Seems to be some leftover of the PreviewController but the actual preview data is no longer shown. Any idea what could cause that?
Do I have to reload the contents of the preview somehow?
I had similar issue and I've managed to pin down the problem to either viewWillDisappear or viewDidDisappear methods. My solution was to subclass QLPreviewController and overwrite those methods with empty implementation i.e. skipping the call to super. I don't know if it's very safe, though I haven't encountered issues and it solved my problem.

IPhone Example : Login Page and then Navigate to another Screen (UI Table View)

I am an .Net Expert but a new to the IPhone App Development. Recently I have started workinf on Objective - c.
I need a help I need a example which shows a Login Screen and then Navigates to the another Screen (UITableView) when username and password and found correct.
As of now I am assuming that username and passwords are hardcoded in app.
I have tried to Design the Screen for Login UI but unable to Load the another ViewController but it wont worked
Can some one help me out with examples, Links?
You need to decide on a navigation paradigm for your app first. Normally in this case, you'd just use a UINavigationController and use the pushViewController method to push a new view into your app.
The UINavigationController acts as a stack of views onto which you can either push new views (in your case) or pop views. Other options you have are listed nicely here - http://flyosity.com/application-design/iphone-application-design-patterns.php
This could be of some help for the tableviewcontroller + UINavigationController - http://icodeblog.com/2008/08/03/iphone-programming-tutorial-transitioning-between-views/