Possible Duplicate:
IOS: call a method in another class
How can i pass an NSArray object to another class ? I don’t want to use extern to access it, so is there any other way i could accomplish this ?
Also note, i am a beginner
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.
In this example
tableDataSourceis aNSArraythat can be accessed as a property of a class.In your
interfacedeclaration (iPadTableWithDetailsViewController.h):Then, in your
implementationdefinition (iPadTableWithDetailsViewController.m):And then you can access this from another class like this:
More good info and examples:
Properties in Objective-C
Tutorial: Using Properties in Objective-C
cocoadevcentral learn objective-c