我有一个返回 NSMutableArray 的方法。我正在从另一个类调用此方法,我想知道如何将返回的 NSMutableArray 放入调用它的类中的接收对象中。
myClass.m
- (NSMutableArray *)getMutableArray
{
// Do some stuff
return myMutableArray
}
mycallingClass.m
- (void)getMeMyMutableArray {
// not really sure what to do here.. but something like.....
// initialize class
myClass *mc = [[myClass alloc] init];
// call myClass method
[mc getMutableArray]; // how do I get the returning value into a mutableArray in this class?
}
希望这是有道理的..任何帮助将不胜感激
最佳答案
NSMutableArray *myArray = [myClass getMutableArray];
关于iphone - 方法的返回值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12470233/