Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS Build a Diary App Using Core Data Inserting and Saving Data UI for Inserting Diary Entries

Ravin Kohli
Ravin Kohli
3,367 Points

Undefined symbols for architecture x86_64

"OBJC_CLASS$THDiaryEntry", referenced from: l_OBJC$CATEGORY_THDiaryEntry$_CoreDataProperties in THDiaryEntry+CoreDataProperties.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

1 Answer

The problem mostly lies in your DiaryEntry custom class. In the NS_ENUM declaration, try using this instead:

typedef enum {
    DiaryEntryMoodGood = 0,
    DiaryEntryMoodAverage = 1,
    DiaryEntryMoodBad = 2
} DiaryEntryMood;

Instead of this:

NS_ENUM( int16_t, DiaryEntryMood ) {
    DiaryEntryMoodGood = 0,
    DiaryEntryMoodAverage = 1,
    DiaryEntryMoodBad = 2
};

That fixed the issue for me. I think the compiler is complaining that 16 bit ints are being used on a newer OS ( El capitan ) that has changed a lot of things. Wouldn't be surprised if it had changed the kernel architecture as well.

Thanksβ€”This Particular Replacement resolves relevant linker errors!