I am really new to Xcode. I don't quite understand exactly what it means when you initialize variables in certain places, but my code works so this isn't the issue... for now. Anyway, here is a my .h file. Everywhere there is a "----" it just means there is code there.
#import <UIKit/UIKit.h>
#import <AVFoundation/AVFoundation.h>
NSInteger charactersLocked[3] = {0,0,1};
int charSel = 0;
@interface Tutorial : UIViewController
{
-------
}
------
@end
So I need to access the array charactersLocked in a different .m file, lets call it File2 and this one File1. When I try to #import "File1.h" in File2.m, the program crashes and gives me this error for both charactersLocked and charSel:
duplicate symbol _charactersLocked in:
/Users/me/Library/Developer/Xcode/DerivedData/SpaceRace-
apawbkpiogvbvddranqfltyybuqr/Build/Intermediates/SpaceRace.build/Debug-
iphoneos/SpaceRace.build/Objects-normal/arm64/Tutorial.o
/Users/me/Library/Developer/Xcode/DerivedData/SpaceRace
apawbkpiogvbvddranqfltyybuqr/Build/Intermediates/SpaceRace.build/Debug-
iphoneos/SpaceRace.build/Objects-normal/arm64/Space.o
I have no idea what this is. I've tried looking for solutions online, but none of them seem to work. I am not importing the .m file by accident. If there is an easier way to just get access to that specific array, please let me know. Sorry if this post was formatted horribly, it is my first time so bear with me. Thank you.