Chapter 11 - Storing Information

This forum contains answers readers may have for each chapter as well as any corrections to the book. The forum also contains the Source Code for the book.

Moderator: gary.bennett

Chapter 11 - Storing Information

Postby gary.bennett » Mon Jan 02, 2017 9:47 pm

Any Questions or Comments, click on the "Post Reply" button below to post. You will need to set up an account first, it just takes a second.


Free Swift Webinars
Every week, xcelMe.com will present free-live iOS Swift Programming Courses, covering topics from Swift for Absolute Beginners Book and beyond.

Register here
Live Q/A and sessions are recorded for later playback here

After registering, you will receive a confirmation email containing information about joining the webinar.
User avatar
gary.bennett
 
Posts: 564
Joined: Thu Feb 26, 2009 3:12 pm

Re: Chapter 11 - Storing Information

Postby gakkie » Tue Feb 21, 2017 6:43 am

Not much going on here. i hope someone is reading this ...

I have a problem with the code from Chapter 11. Following the book to the letter, double checking everything, and I've done the whole Core Data project twice now, but as soon as I create the classes via editor > create NSmanagedOject Subclass, I get a lot of errors in my project. At first I thought these would go away as I complete the project. But they did not.

The errors I get are most like:

Code: Select all
/Users/*****/Documents/Swift 3 for Absolute Beginners/Chapter 11/BookStoreCoreData/BookStoreCoreData/Book+CoreDataProperties.swift:14:11: 'Book' is ambiguous for type lookup in this context


The same error for the Author class and also

Code: Select all
/Users/*****/Documents/Swift 3 for Absolute Beginners/Chapter 11/BookStoreCoreData/BookStoreCoreData/Book+CoreDataProperties.swift:23:5: @NSManaged only allowed on an instance property or method


I have no idea how to fix this. Somehow Xcode thinks there are two Book classes ??
Last edited by gakkie on Tue Feb 21, 2017 9:03 am, edited 1 time in total.
gakkie
 
Posts: 0
Joined: Sun Jan 29, 2017 6:31 am

Re: Chapter 11 - Storing Information

Postby gakkie » Tue Feb 21, 2017 6:59 am

I managed to figure out where it goes wrong, there are copies of my swift files in

Code: Select all
/Users/*****/Library/Developer/Xcode/DerivedData/BookStoreCoreData-bzugfcrpozxtbybyqnsvzljofszj/Build/Intermediates/BookStoreCoreData.build/Debug-iphonesimulator/BookStoreCoreData.build/DerivedSources/CoreDataGenerated/BookStoreCoreData


Is this a bug in Xcode? I'll try and delete the files there!

EDIT
deleting doesn't work, the files reappear there after building ...
gakkie
 
Posts: 0
Joined: Sun Jan 29, 2017 6:31 am


Return to Book -> Swift 3.0 for Absolute Beginners: iPhone and Mac Programming Made Easy 3rd Edition

cron