How can i define a STATIC array of numbers accessible to all methods in my class???
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.
The same way you’d do it in C:
If you want a static
NSArray, you’ll have to do some tricks.staticisn’t allowed for object types in Objective-C (since you can’t declare an object directly – only pointers). In that case, you need to read up on Objective-C singletons. A quick way to implement it:You can, of course, set it up to initialize with whatever kind of objects you’d like.