I’m just looking at NSString.h and wonder why some method declaration args use
(NSString *)string; while others use (NSString *)aString.
What are the conventions practiced here?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s simply the indefinite article “a”, as in the parameter is “a string”. It appears in some methods to make them read a little more like English. For example,
compare:(NSString*)aStringreads as “compare a string”. The official naming conventions for method parameters are rather basic; they show the use of the indefinite article but don’t explain why.