Objective-C LanguageBasic Data Types


Syntax

  • BOOL havePlutonium = YES;    // Direct assigment
  • BOOL fastEnough = (car.speedInMPH >= 88);    // Comparison expression
  • BOOL fluxCapacitorActive = (havePlutonium && fastEnough);    // Boolean expression
  •  
  • id somethingWicked = [witchesCupboard lastObject];    // Retrieve untyped object
  • id powder = prepareWickedIngredient(somethingWicked);    // Pass and return
  • if ([ingredient isKindOfClass:[Toad class]]) {    // Test runtime type