this has been bugging me all morning, I have searched the hell out of this website and I can't find any reference to this issue.
Within my project I have 2 objects with circular dependancies set up exactly like this;
ClassA.h
@class ClassB;
@interface ClassA : NSObject {
ClassB *foo;
}
@end
ClassA.m
#import "ClassB.h"
@implementation ClassA
// Whatever goes here
@end
ClassB.h
@class ClassA;
@interface ClassB : NSObject {
ClassA *foo;
}
@end
ClassB.m
#import "ClassA.h"
@implementation ClassB
// Whatever goes here
@end
(CREDIT - Does Objective-C allow circular dependencies?)
This technique has been used by myself in several projects and up to now it was worked totally fine, each of the objects have been able to access each others properties perfectly.
A couple of days ago I added a few methods to ClassA and tried calling them from ClassB, again this worked totally fine..... so i thought, the problem is that I have been testing on iPhones with various OS versions on them but they have all been iPhone5S and above. Today I ran the project on the iPad2 simulator and it crashes when running SOME OF the methods, the same happens with iPhone4S and iPhone5 Simulators.
The methods I have in ClassA are just simple setters for example;
-(void)setHomeButtonPageContents:(NSString*)contents Index:(int)index
{
homeButtonPageContents[index]=contents;
}
They are all variations of the above, some setting colours some setting fonts, but on the older devices (iPad2, iPhone4S & iPhone5) some work some don't.
Any Ideas?!?!