Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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!