Is there any way to specify what specific type of object can be contained within an NSMutableArray?
EDIT More specifically… Is there a way to restrict the class that the object must belong to?
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.
Well, you could always subclass
NSMutableArraybut as everyone else has said, it is hard to imagine a good reason to do this….From Subclassing Notes in the docs you would basically have to over-ride the following functions and check for the proper class: