RAMAN RANA
RAMAN RANA

Reputation: 1795

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

I want to send Mutable Array with 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...

Upvotes: 0

Views: 215

Answers (2)

GhostRider
GhostRider

Reputation: 1207

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;

Upvotes: 0

Di Wu
Di Wu

Reputation: 6448

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.

Upvotes: 1

Related Questions