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

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

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.

Create custom animated segue with images?

I am trying to build a custom segue for an iOS app that utilizes images on the top and bottom of the screen (like a header and footer) that will slide up/down (out), transition to the next page, then slide back in. I found a simple tutorial that does the animation that I would like to use, but I am stuck trying to implement it into a segue.
Is this possible? If so, how? I have barely found any documentation on what I would like to do, and I am royally stuck!
Thanks in advance.
Animation tutorial: http://www.raywenderlich.com/2454/how-to-use-uiview-animation-tutorial
iOS 7
What you're asking about is possible with new APIs. However, iOS 7 is currently under NDA. Please avoid asking iOS 7 related questions on Stack Overflow until the SDK, Toolchain, and OS go final. Ask this question on the iOS Developer Forums. When iOS 7 becomes public, I'll edit this answer to describe how to do it.
Meanwhile (since you're a registered developer), I can point you to a few resources that may be of interest (you may need to sign in to access them).
WWDC Videos
The video titled Building User Interfaces for iOS 7 introduces the new Segue animations and techniques. The part of interest is around the 18:30 minute mark.
The video titled Custom Transitions using View Controllers goes in depth to explain the new custom animated segues and how to use them.
Creating Custom Segues - Pre-release documentation
Posts about Segue's on the Dev Forums - Just search the Developer Forums
iOS 5 - 6
Creating custom segues in earlier versions of iOS (5.0 and up) is fairly straightforward, unlike iOS 7 - the animations can't really interact with views within your ViewController and they aren't as dynamic.
To setup a custom segue, you'll need to first create a subclass of uistoryboardsegue (Documentation Here). Override the perform method and add your own animation and drawing code:
- (void)perform {
//Add your own animation code here, then present the View Controller using that custom animation
[[self sourceViewController] presentModalViewController:[self destinationViewController] animated:NO];
}
Now that you've subclassed UIStoryboardSegue and created your own animation, you'll need to connect the segue in Interface Builder.
Create the Segue by Control-Dragging from the source view controller to the destination view controller.
Select custom from the list
Name the Segue by setting its Identifier (this way you can also call the segue using the performSegueWithIdentifier:sender:) method. Then set the Segue Class to the name of your UIStoryboardSegue subclass.

How to replace the FirstViewController in a TabBar app with another view controller (Kal)?

I created an empty iPad TabBar application using XCode 4, without storyboards. I placed that app in a workspace. I then added the Kal source (obtained from the iPad Juice build) to the workspace as a separate project. The initial build was clean.
I then went to the Kal example (NativeKal) and added EventKitDataSource.h and .m, and NativeCalAppDelegate.h and .m. (The image below shows what files are in the example project)
This is the code from the NativeCalAppDelegate.h file:
I tried setting the first TabBar UIView controller to "KalViewController" as I would normally do when using Storyboards, but it isn't listed in the drop down list of classes.
The question is: how do I get the NativeCal example view controller to replace FirstViewController in the in my TabBar application?
Comments added as Answer.
My recommendation is to switch to storyboards it is a lot easier to do UITabBarControllers in them. You can do this by just creating a new storyboard and copy and paste everything into it and then control drag from the UITabBarController to the UIViewControllers that you want to be linked to the tab bar controller and it does the rest for you, everything else is the same after that. In storyboards you can set the first view controller to be loaded so if you need it to be KalController then you can set it when you set up the UITabBarController. You can also set this in the code. I found that storyboards were a great new feature to xcode, UITabBarCotrollers are a lot easier to do in them then in .nib files I could never get them to work.
Hope this has helped.

SIGABRT error when setting Tab Bar View Controller to custom view controller

I have been developing an iPhone application using the Detail View template. At some point I realized that I wanted my application to have a Tab Bar View controller as the root view controller. It seems that you do not want to push a tab bar view controller onto a navigation view controller. So I decided to start a new tab bar project and migrate my existing application code over. I thought this would be easiest.
So I have done that and the project builds without a problem. But I cannot seem to reassign the tab bar view controllers to ones which I already have. So I am replacing, "FirstViewController" with one of my custom ones. When I attempt to run the application it calls:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
And bombs with a SIGABRT error. I'm not sure why this is. I cannot see what the default view controller (firstviewcontroller) is implementing that my custom view controller is not.
Can anyone give me some ideas of what I should check?
Thanks!
update
It seems that my problem is related to the fact that my custom viewcontroller is of type UITableViewController. If I change this to be of type UIViewController it seems to work.
Update
I added a Navigation controller to the storyboard and created a relationship from it to a blank TableViewController. Then I assigned this TableViewController to my custom UITableViewController class. This seems to work. I'm not sure what plumbing was missing before.

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.