2011-08-29 56 views
0

我正在为iPhone编写一个小程序。 我增加了同一个类中的数组[MyArray addObject:[NSNumber numberWithInt:MyNumber]] ;.我想访问另一个类中的这个数组的元素。我可以怎样做?从另一个类访问一个NSMutableArray元素

+1

复制[这个问题](http://stackoverflow.com/questions/3527619)和[更多](http://stackoverflow.com/search?q=access+from+another+class+iphone)。 – zoul

+0

看看这个http://stackoverflow.com/questions/6522141/how-to-passing-a-nsmutablearray-to-another-viewcontroller-class/6522480#6522480 –

+0

@Vijay - 你的解决方案似乎没有解决他的问题,即使它被接受... – TommyG

回答

0

在您的第一个类中写入此代码aArray = [[NsmutableArray alloc] initwithobject:yourobjectname mutablecopy];设置NSArray的财产这一类。现在你可以访问此变量其他类