I am updating my app to 64 bit.
I save doc by looking at all the objects and saving them in a document.
32bit Object
@interface mySquare : NSObject
@property int someInt;
@property float someFloat;
@property CGPoint beginPos;
@property CGPoint endPos;
-(void) applyStrokeTypeAndColor:(CGContextRef)context;
@end
How I Save (Abstract Concept)
for (MyObjects *obj in self.objects) {
[obj archiveTo:file];
}
To read them (Abstract Concept)
for (int i = 0; i < cnt; i++) {
NSString *clsName = [MyObjects objectNameOfData:file];
MyObjects *obj = [NSClassFromString(clsName) new];
[obj readFrom:file];
if (self.targetView == MyView) {
[self.objects addObject:obj];
}
}
Suffice it to say, this method works. And has worked great for years for the type of app I have built. Reading an object, saving it, reading it back in and casting it to the correct class type.
If the file is created on 32 bit app it opens on the the "32 bit" version, they open fine.
After updating to 64 bit, files created in "64 bit" open fine, but the those created using the 32 bit method do not. The file is loaded and if I log out any information, I can see that each object is being read in, but, I am assuming losing data (obviously) in the progress.
64 bit Object
@interface mySquare : NSObject
@property long someInt; //was int
@property CGFloat someFloat; //was float
@property CGPoint beginPos;
@property CGPoint endPos;
-(void) applyStrokeTypeAndColor:(CGContextRef)context;
@end
As you can see above, the only thing that changed with the 64 bit objects was the Reference Type.
I have built in a way to distinguish files created in my 32 bit vs 64 bit. I just changed the 64bit file extension to "myExt2" so the program knows which "version" the file was created in and prevent old versions of the app from even seeing the new 64 bit files.
I am afraid I am out of my league when in the realm.
How can I cast my 32-bit files (or in app convert them) to open in my 64-bit program? I can't send out an update of my app without legacy file support.