Vote count:
0
since its not (yet) possible to use the Storyboard for generating classes and glue code. I had the idea to write the F# classes on my own and do the glueing myself.
So I written this loading of the Storyboard namespace
open System
open MonoTouch.UIKit
open MonoTouch.Foundation
[<Register("AppDelegate")>]
type AppDelegate() =
inherit UIApplicationDelegate()
member val window = null with get, set
override this.FinishedLaunching(app, options) =
this.window <- new UIWindow(UIScreen.MainScreen.Bounds)
let Storyboard = UIStoryboard.FromName("MainStoryboard", null)
this.window.RootViewController <- Storyboard.InstantiateInitialViewController() :?> UIViewController
this.window.MakeKeyAndVisible()
true
module Main =
[<EntryPoint>]
let main args =
UIApplication.Main(args, null, "AppDelegate")
0
and the following controller class
open System
open System.Drawing
open MonoTouch.UIKit
open MonoTouch.Foundation
[<Register("HomeController")>]
type HomeController() =
inherit UIViewController()
override this.ViewDidLoad() =
base.ViewDidLoad()
System.Console.WriteLine("FOO!")
Then I created the Storyboard (see attached pictures).
AND - everything gets loaded and the storyboard works fine - One exception: ViewDidLoadnever gets called. Obviously I was not successful in attaching my hand coded controller.
Does anybody have an idea how do accomplish this?
asked 1 min ago
How can I use Xamarin's Storyboard and F#
Aucun commentaire:
Enregistrer un commentaire