update samples to use UIControllers (because otherwise a warning is printed in iOS 5.0)

This commit is contained in:
Laurent Sansonetti
2011-11-04 22:03:49 +01:00
parent a593d408a1
commit c471e01735
4 changed files with 53 additions and 41 deletions

View File

@@ -1,4 +1,4 @@
class MyView < UIView
class HelloView < UIView
def drawRect(rect)
if @moved
bgcolor = begin
@@ -32,11 +32,18 @@ class MyView < UIView
end
end
class HelloViewController < UIViewController
def loadView
self.view = HelloView.alloc.init
end
end
class AppDelegate
def application(application, didFinishLaunchingWithOptions:launchOptions)
window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds)
view = MyView.alloc.initWithFrame(window.frame)
window.addSubview(view)
window.rootViewController = HelloViewController.alloc.init
window.rootViewController.wantsFullScreenLayout = true
window.makeKeyAndVisible
return true
end
end