News for hackers. Stuff that matters.
Re:nil, Nil, NULL, NSNull by scrumper on Monday January 07, 2013 @01:38PM (#5022406)
Any use cases for Nil, that is, the class pointer to nothing? I've not seen it in the wild (which isn't saying a great deal.)
Re:nil, Nil, NULL, NSNull by mmariani on Monday January 07, 2013 @02:14PM (#5022595)
You could use it to test whether or not you really got a class from NSClassFromString(). For instance:

  Class _myClass;
  // aClassName was previously defined
  if((_myClass = NSClassFromString(aClassName)) == Nil)
     [NSException raise:@"InvalidClass" 
                 reason:@"Unknown class named %@.", aClassName);
  
  id myObj = [[_myClass alloc] init];
  [myObj whatever];
Re:nil, Nil, NULL, NSNull by scrumper on Monday January 07, 2013 @02:23PM (#5022653)
Makes sense, thanks.