Browse files

correctly initialize settings view

  • Loading branch information...
1 parent a498ab7 commit d50ed514a2569d154faf7633b6262ff37a5e8c5a @mordaroso committed May 11, 2012
Showing with 10 additions and 6 deletions.
  1. +0 −1 app/controllers/settings_controller.rb
  2. +10 −5 app/views/settings_view.rb
View
1 app/controllers/settings_controller.rb
@@ -1,7 +1,6 @@
class SettingsController < UIViewController
def loadView
self.view = SettingsView.alloc.init
- self.view.backgroundColor = UIColor.groupTableViewBackgroundColor
self.view.setNeedsDisplay
end
end
View
15 app/views/settings_view.rb
@@ -1,9 +1,14 @@
class SettingsView < UIView
- def drawRect(rect)
- @user = UIApplication.sharedApplication.delegate.user
- drawUsername
- drawPassword
- drawButton
+
+ def initWithFrame(rect)
+ if super
+ self.backgroundColor = UIColor.groupTableViewBackgroundColor
+ @user = UIApplication.sharedApplication.delegate.user
+ drawUsername
+ drawPassword
+ drawButton
+ end
+ self
end
def drawUsername

0 comments on commit d50ed51

Please sign in to comment.