diff --git a/07_KVC/KVCFun_A/nu/main.nu b/07_KVC/KVCFun_A/nu/main.nu index e448980..808b297 100755 --- a/07_KVC/KVCFun_A/nu/main.nu +++ b/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 diff --git a/07_KVC/KVCFun_FINAL/nu/main.nu b/07_KVC/KVCFun_FINAL/nu/main.nu index 845ea37..f0f450e 100755 --- a/07_KVC/KVCFun_FINAL/nu/main.nu +++ b/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)