I have a method in a NSObject Class that I am executing from another ViewController Class, I would like to reutrn a NSMutableArray however I am not sure how to pass that into a variable in the ViewController class.
Updated Code:
NSObject Class is called Axis
Axis.h // declare my method here with return type of NSMutableArray
- (NSMutableArray *)assignAxes:(NSArray*)axesData;
Axis.m
- (NSMutableArray *)assignAxes:(NSArray*)axesData {
//..
//pass some NSDictionaries into a MutableArray called myMutableArray
return myMutableArray;
}
Now I have a View Controller called FinalViewViewController and I want to call assignAxes method from this viewController, and I would like to put the returning myMutableArray into a mutableArray variable in FinalViewViewController but am not sure how... I only know how to call the method not pass the returning value into a variable to be used.
FinalViewViewController.m
Axis *axis = [[Axis alloc] init];
NSMutableArray *tempGetSeriesObjArray = [[NSMutableArray alloc] init]; // create holder variable for returning mutableArray
tempGetSeriesObjArray = [axis assignAxes:series]; // gives an error
This is the error I am getting from that last line of code
Incompatible pointer types assigning to 'NSMutableArray *__strong' from 'Axis *'
any help would be appreciated.
init, or pass the value via a property.