I'm in some kind of structuring trouble here because I'm not sure if what I'm trying to do is possible:
I have three custom classes that represent types of instructions translated from machine code. Each class has properties like the function of the instruction and the operands. They get initialised and translated into instances in the third VC and put in an NSMutableArray and I successfully move that NSMutableArray to the fourth VC. Now, I need to loop through each object of the array (not knowing which type of class it is) and access the "instruction" property of it (an NSString, that is). Is that possible?
Declaration example of one of the classes:
@interface iInstruction : NSObject
@property (strong) NSString *opCode;
@property (strong) NSString *rs;
@property (strong) NSString *rt;
@property (strong) NSString *immediate;
@property (strong) NSMutableString *instruction;
- (id) initWithBinary: (NSString *) binaryInstruction;
How the instance is created and moved to fourth VC:
iInstruction *NewI = [[iInstruction alloc] initWithBinary:binary32Bits];
[TranslatedCode appendFormat:@"%@\n", NewI.instruction];
[instructions addObject: NewI];
disassembledCode.text = TranslatedCode;
FourthViewController *theVCMover = [self.tabBarController.viewControllers objectAtIndex:3];
theVCMover.instructionsInfo = instructions;
A failed attempt of what I'm trying to do:
for (NSUInteger i=0; i < [instructionsInfo count]; i++) { //instructionsInfo is a property of the fourth VC that I use to move the main array from the third VC
NSString *function = [instructionsInfo objectAtIndex:i].instruction; //Of course it says property not found because it only receives the NSMutableArray at runtime
if (function isEqualToString:@"andi") {
}