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 Inserting a Managed Object

ns_enum error

After creating the insertDiaryEntry method, in the THNewEntryViewController.m file I get this error message.

duplicate symbol _THDiaryEntryMood in: /Users/blaynechong/Library/Developer/Xcode/DerivedData/5-Diary-fefwxjwtipxgpohievpqmqmplivu/Build/Intermediates/5-Diary.build/Debug-iphonesimulator/5-Diary.build/Objects-normal/x86_64/THNewEntryViewController.o /Users/blaynechong/Library/Developer/Xcode/DerivedData/5-Diary-fefwxjwtipxgpohievpqmqmplivu/Build/Intermediates/5-Diary.build/Debug-iphonesimulator/5-Diary.build/Objects-normal/x86_64/THDiaryEntry.o ld: 1 duplicate symbol for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

It points to the block of code that we wrote previously in the THDiaryEntry.h file.

NS_ENUM(int16_t, THDiaryEntryMood) { THDiaryEntryMoodGood = 0, THDiaryEntryMoodAverage = 1, THDiaryEntryMoodBad = 2 };

When i comment out this code my program runs, but I would love to have a permanent solution for this problem. Can somebody help please?

Gabe Nadel
Gabe Nadel
Treehouse Guest Teacher

Can you post the complete code from those files which you think might be causing the issue? The more code (and explanation) the better.