0

I have basic Objective c questions.

First look at the following 3 lines. Second line is getting property using pointer variable(string_ptr) Third line is a message expression using pointer variable(string_ptr)

NSString *string_ptr = [[NSString alloc] initWithString:@"123"];
string_ptr.absolutePath;
[string_ptr isAbsolutePath];

I want to know whether every property can be accessed by '.' (dot) like second line or not?

I also want to know whether any property(not method) can be directly accessed by message expression or not.

I also want to know whether any method can be called with '.' (dot) like c++ function or not.

Because i think i have called some function of some class like following before, But i forgot its example. So i am curious about what is actual difference with message expression and calling method with '.'(dot).

obj.aaaamethod;
Knowledge Drilling
  • 986
  • 1
  • 8
  • 22
  • Strongly related: http://stackoverflow.com/questions/1249392/dot-notation-vs-message-notation-for-declared-properties. – Martin R Jan 08 '17 at 14:27
  • I want to know whether every property can be accessed by '.' (dot) like second line or not? YES I also want to know whether any property(not method) can be directly accessed by message expression or not. YES (getter== propName, setter= setPropName) I also want to know whether any method can be called with '.' (dot) like c++ function or not. NO. See: http://rypress.com/tutorials/objective-c/properties – shallowThought Jan 08 '17 at 15:04

0 Answers0