and Number came from Lee Boynton, one of the early NeXT Obj-C class library guys who hated 'int' and 'float' types." Patrick Naughton (one of the original creators of Java)
two = 2; String equals = " = "; float three = 3.0f; String s = one + two + equals + three; NSString *one = @"1 +"; int two = 2; NSString *eq = @"="; float three = 3.0; NSString *s = [NSString stringWithFormat:@"%@ %d %@ %.1f", one, two, eq, three]; But... If I can use C++ then I can use operator overloading to add that to Objective-C, right?
two = 2; String equals = " = "; float three = 3.0f; String s = one + two + equals + three; NSString *one = @"1 +"; int two = 2; NSString *eq = @"="; float three = 3.0; NSString *s = [NSString stringWithFormat:@"%@ %d %@ %.1f", one, two, eq, three]; But... If I can use C++ then I can use operator overloading to add that to Objective-C, right? Nop :(
the Smalltalk-80 style of object-oriented programming onto a C language rootstock. Objective-C adds precisely one new data type, the object[...]and precisely one new operation, the message expression. " Cox, Brad J. (1991). Object Oriented Programming: An Evolutionary Approach
programming interfaces conceptually derived from the Objective-C-based Foundation framework but implemented in the C language. To do this, Core Foundation implements a limited object model in C. Core Foundation defines opaque types that encapsulate data and functions, hereafter referred to as “objects.”
are retained and released automatically as the block is copied and later released.” “If you use a block within the implementation of a method [...] If you access an instance variable by reference, self is retained; If you access an instance variable by value, the variable is retained.” “When you copy a stack-based block, you get a new block. If you copy a heap-based block, however, you simply increment the retain count of that block and get it back as the returned value of the copy function or method.”