Answer the question
In order to leave comments, you need to log in
How to pass an NSMutableArray with objects of the same class to a method?
I need to make sure that I can pass an NSMutableArray with objects of only one type to my method. Like List in C#. How to do it?
Answer the question
In order to leave comments, you need to log in
Ideally, refuse to operate NSMutableView, and make the class that contains it a container by adding the methods
-addObject
-removeObject
-(NSArray*) objects
And either control uniqueness at the adding stage or at the extraction stage (-objects). Through the same Array Filtering. Well, either before passing the array as a parameter, carry out the same filtering. Unfortunately, or perhaps fortunately, arrays in foundation can contain any objects
. By the way, what you want to do is perfectly done in swift . Objective c and swift code mixes without problems. And in general, it will be easier to move from c # to swift
No way. Foundation does not have typed containers. You can write your own container that will check the type of elements, you can give it at the mercy of the called function, the implementation will be the same
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question