I am new to Objective C and am trying out some basic concepts but hitting a few brick walls
Essentially what I am trying to do is write a class that returns an array when messaged from another class
The class that returns the value would be something like -
ReturnClass.h
#import <Foundation/Foundation.h>
@interface ReturnClass : NSObject {
}
-(NSMutableArray *) getLocation ;
@end
ReturnClass.m
#import "ReturnClass.h"
@implementation ReturnClass
-(NSMutableArray *) getLocation {
//do some stuff to populate array
//return it
return latLngArray;
}
@end
I then wanted to call this in to another implementation in order to harvest the value
SomeOtherClass.m
#import "ViewController.h"
#import "ReturnClass.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
NSMutableArray *latLngArray = [[getLocation alloc] init];
}
I appreciate there is probably a fair bit wrong with this but please be gentle as I am trying to learn :)