i just started iOS programming and am trying to compile a simple code but am unable to do so. The error messages i received are,
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_Player", referenced from:
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Now, i have found 2 similar questions (here and here) that are using the same environment as i am to code and are facing similar issues as i am too. I have tried their solutions but am unsuccessful.
As i just started iOS, i was using this tutorial as a guide and am trying to run their code. The error occurs at the part where i assign some value to the player variable. Code are as follows.
#import "AppDelegate.h"
#import "Player.h"
#import "PlayersViewController.h"
@interface AppDelegate ()
@end
@implementation AppDelegate{
NSMutableArray *_players;
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
_players = [NSMutableArray arrayWithCapacity:20];
Player *player = [[Player alloc] init];
player.name = @"Bill Evans"; //error will occur here
return YES;
}
My Architecture settings are as follows,
The code for the Player.h and PlayersViewController.h are exactly the same with those from the tutorial.
Update
Player.h
@interface Player : NSObject
@property (nonatomic, copy) NSString *name;
@property (nonatomic, copy) NSString *game;
@property (nonatomic, assign) int rating;
@end
PlayersViewController.h
#import <UIKit/UIKit.h>
@interface PlayersViewController : UITableViewController
@property (nonatomic, strong) NSMutableArray *players;
@end
My build results