I have a method with the signature - (void)addStringsToArray. I want to call it in the viewDidLoad method. How do I call it?
I have a method with the signature – (void)addStringsToArray . I want to call
Share
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.
Method calls (or, actually, message sends) in Objective-C have the syntax
[receiver selector].Here,
objectis the receiver, andaddStringsToArrayis the selector. Useselfas the receiver if your method is in the same class as the current method (i.e. your view controller).I highly recommend you to read The Objective-C Programming Language. The answer to your question is under “Object Messaging” in the first chapter.