The source code to view

  • name
    • You can think of it as the name of a function like – (void) test; The function name is test
  • imp
    • Pointer to the address of the function

types

  • Defines a value function with no arguments and no return

  • types = v16@0:8
    • v = void
    • @ The first parameter id type
    • : the second parameter SEL
  • OC methods are essentially C language functions that pass two arguments by default

    • void = v

    • int = i

    • id = @

    • SEL = :

  • Now make a function with a return value and an argument and look at types
    • i24@0:8i16f20
      • The first I is equal to int
      • @ = id
      • : = SEL
      • i = int
      • f = float
    • A number is how many bytes a parameter takes up
      • Id is equal to 8 and we start at 0 plus 8
      • SEL is equal to 8 and we start at 8 plus 8
      • Int is equal to 4 starting at 16 plus 4
      • Float = 4 starting at 20 + 4
      • 8 + 8 + 4 + 4 = 24