Hello everyone!
I am new to Objective-C and iPhone development but already program 5+ years in PHP with extensive OOP knowledge.
However I am struggling to understand the concept of pointers that is extensively used in objective-C programs.
I understand that pointers are pointing to the actual address in memory of where the variable rests but I don't understand why should I care.
Why should I assign a variable the address and not the actual result?
Why this:
and not this:
Thanks for your answers!
I am new to Objective-C and iPhone development but already program 5+ years in PHP with extensive OOP knowledge.
However I am struggling to understand the concept of pointers that is extensively used in objective-C programs.
I understand that pointers are pointing to the actual address in memory of where the variable rests but I don't understand why should I care.
Why should I assign a variable the address and not the actual result?
Why this:
Code:
NSString *myText = [[NSString alloc] init];
and not this:
Code:
NSString myText = [[NSString alloc] init];
Thanks for your answers!