开发者

How to send All objects of Mutable Array to Another Class?

开发者 https://www.devze.com 2023-01-31 08:22 出处:网络
I want to send Mutable Array w开发者_运维知识库ith all its objects from my First Class to Second Class. I have no idea how can i do this please anybody tell me the way... Try this:

I want to send Mutable Array w开发者_运维知识库ith all its objects from my First Class to Second Class. I have no idea how can i do this please anybody tell me the way...


Try this:

yourSecondClass.mutableArray_asAMemberVariable = [[yourFirstClass mutableArray_asAMemberVariable] copy];

This makes a copy out your firstClass mutable array and sends it to your second class.


you make one declare mutable array and make it property on other class where you want to then just give like follow

vc.nsmutablearray = the_array_you_want_to_send;

0

精彩评论

暂无评论...
验证码 换一张
取 消