Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Beautified main.nu files in 07_KVC

  • Loading branch information...
commit bd33a8bd101b1be4dd07e27082d6cb65343fca5e 1 parent ac89f2a
@jsyedidia jsyedidia authored
Showing with 22 additions and 22 deletions.
  1. +15 −15 07_KVC/KVCFun_A/nu/main.nu
  2. +7 −7 07_KVC/KVCFun_FINAL/nu/main.nu
View
30 07_KVC/KVCFun_A/nu/main.nu
@@ -9,24 +9,24 @@
;; Set the global variable $ac equal to the appController for easy access in the console.
(set $ac self)
(self setValue:5 forKey:"fido")
- (set n (self valueForKey:"fido"))
- (NSLog "fido = #{n}")
+ (set n (self valueForKey:"fido"))
+ (NSLog "fido = #{n}")
self)
+
+ (- (void) incrementFido: (id) sender is
+ ;; We don't need to call willChangeValueForKey or didChangeValueForKey
+ (set @fido (+ @fido 1))
+ (NSLog "fido is now #{@fido}"))
+
+ (- (int) fido is
+ (NSLog "-fido is returning #{@fido}")
+ @fido)
+
+ (- (void) setFido: (int) x is
+ (NSLog "-setFido: is called with #{x}")
+ (set @fido x)))
- (- (void) incrementFido: (id) sender is
- ;; We don't need to call willChangeValueForKey or didChangeValueForKey
- (set @fido (+ @fido 1))
- (NSLog "fido is now #{@fido}"))
-
- (- (int) fido is
- (NSLog "-fido is returning #{@fido}")
- @fido)
-
- (- (void) setFido: (int) x is
- (NSLog "-setFido: is called with #{x}")
- (set @fido x)))
-
(set SHOW_CONSOLE_AT_STARTUP nil)
;; @class ApplicationDelegate
View
14 07_KVC/KVCFun_FINAL/nu/main.nu
@@ -10,14 +10,14 @@
;; Set the global variable $ac equal to the appController for easy access in the console.
(set $ac self)
(self setValue:5 forKey:"fido")
- (set n (self valueForKey:"fido"))
- (NSLog "fido = #{n}")
+ (set n (self valueForKey:"fido"))
+ (NSLog "fido = #{n}")
self)
-
- (- (void) incrementFido: (id) sender is
- ;; We don't need to call willChangeValueForKey or didChangeValueForKey
- (set @fido (+ @fido 1))
- (NSLog "fido is now #{@fido}")))
+
+ (- (void) incrementFido: (id) sender is
+ ;; We don't need to call willChangeValueForKey or didChangeValueForKey
+ (set @fido (+ @fido 1))
+ (NSLog "fido is now #{@fido}")))
(set SHOW_CONSOLE_AT_STARTUP nil)
Please sign in to comment.
Something went wrong with that request. Please try again.