Not the best naming convention but take a look at the following example. You declare a public property in the Questions object and access it from the controller after you initialised a new object there. You may consider declaring it readonly and set it to readwrite in the private interface extension.
Questions.h
#import <Foundation/Foundation.h>
@interface Questions : NSObject
@property NSMutableArray *questions;
@end
Questions.m
#import "Questions.h"
@implementation Questions
-(id) init {
if (self = [super init]) {
_questions = @[4,5,6];
}
return self;
}
@end
ViewController.m
#import "Questions.h"
-(void)generateRandomQuestionOrder {
Questions *theQuestions = [[Questions alloc] init];
NSLog(@"%@", [theQuestions.questions description]);
}
2
solved count NSArray from another class