Advertisement
Guest User

Untitled

a guest
Jun 25th, 2014
267
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.51 KB | None | 0 0
  1. // Playground - noun: a place where people can play
  2.  
  3. import Foundation
  4.  
  5. /*
  6.   If this class inherits from NSObject, then
  7.   println(weekSelections[0]) prints "false" below.
  8.   If it doesn't inherit from NSObject, it prints "true".
  9. */
  10. class Foo : NSObject {
  11.     var weekSelections: Array<Bool>!
  12.     func test() {
  13.         weekSelections = Array<Bool>(count: 10, repeatedValue: false)
  14.         weekSelections[0] = true;
  15.         println(weekSelections[0]) // Prints "false"
  16.     }
  17. }
  18.  
  19. var foo = Foo()
  20. foo.test()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement