small medium large xlarge

Back to: All Forums  Core Data
Generic-user-small
20 Apr 2009, 16:38
Dee Wu (1 post)

Hi,

Trying to get the Spotlight example to compile from Mark’s Code mzcd-code.zip.

It generates the following error? Any tips how to correct it to compile?

Building target “GrokkingRecipes” of project “Spotlight” with configuration “Debug” — (2 errors)
	    cd /Users/deewu/Desktop/CoreDataCode/Spotlight
    /Developer/usr/bin/mapc /Users/deewu/Desktop/CoreDataCode/Spotlight/v1_to_v2.xcmappingmodel /Users/deewu/Desktop/CoreDataCode/Spotlight/build/Debug/GrokkingRecipes.app/Contents/Resources/v1_to_v2.cdm


/Users/deewu/Desktop/CoreDataCode/Spotlight/v1_to_v2.xcmappingmodel: error: Attribute Mapping "RecipeIngredientToRecipeIngredient".name -- destination entity doesn't have property named name
/Users/deewu/Desktop/CoreDataCode/Spotlight/v1_to_v2.xcmappingmodel: error: Attribute Mapping "RecipeIngredientToRecipeIngredient".unitOfMeasure -- destination entity doesn't have property named unitOfMeasure
mapc error - mapc failed to compile file /Users/deewu/Desktop/CoreDataCode/Spotlight/build/Debug/GrokkingRecipes.app/Contents/Resources/v1_to_v2.cdm
		/Users/deewu/Desktop/CoreDataCode/Spotlight/v1_to_v2.xcmappingmodel: error: Attribute Mapping "RecipeIngredientToRecipeIngredient".name -- destination entity doesn't have property named name
		/Users/deewu/Desktop/CoreDataCode/Spotlight/v1_to_v2.xcmappingmodel: error: Attribute Mapping "RecipeIngredientToRecipeIngredient".unitOfMeasure -- destination entity doesn't have property named unitOfMeasure
Build failed (2 errors)
Avatarsmall_pragsmall
30 Apr 2009, 21:44
Marcus S. Zarra (284 posts)

Looks like there is an issue with the sample code and its mapping models. I will get this corrected as soon as possible.

Thank you for bringing it to my attention.

Bathyjb1_pragsmall
02 Jan 2010, 14:20
Ronald Bell (12 posts)

The Spotlight example still compiles with these errors (re-downloaded on 1-2-2010).

Furthermore, the @ProgressiveMigration@ example now compiles with mostly the same errors, which it didn’t previously do, did it? (directory paths trimmed a bit for readability):

Downloads/code/ProgressiveMigration/v1_to_v2.xcmappingmodel: error: Attribute Mapping "RecipeIngredientToRecipeIngredient".name -- destination entity doesn't have property named name
Downloads/code/ProgressiveMigration/v1_to_v2.xcmappingmodel: error: Attribute Mapping "RecipeIngredientToRecipeIngredient".unitOfMeasure -- destination entity doesn't have property named unitOfMeasure
mapc error - mapc failed to compile file Downloads/code/ProgressiveMigration/build/Debug/GrokkingRecipes.app/Contents/Resources/v1_to_v2.cdm

I don’t think it’s in the mapping. To me, it looks like the v2 datamodels have been corrupted, and they now look like the v3 datamodels. They certainly aren’t the same as the v2 datamodel in the v2 app.

Also, while we’re talking about code not working, the MultiThreading app crashes to the debugger, when I run it (nothing trimmed):

2010-01-02 08:03:39.642 GrokkingRecipes[11205:a0f] *** Assertion failure in -[AppDelegate progressivelyMigrateURL:ofType:toModel:error:], /Users/rbell/Downloads/code/MultiThreading/AppDelegate.m:492
2010-01-02 08:03:39.645 GrokkingRecipes[11205:a0f] An uncaught exception was raised
2010-01-02 08:03:39.645 GrokkingRecipes[11205:a0f] Failed to find source model
{
    NSPersistenceFrameworkVersion = 250;
    NSStoreModelVersionHashes =     {
        Author = <6666fad9 a6555ff4 bed5f65a e8e81ec7 980dd712 c420378a 239d1830 8a1ccd04>;
        Ingredient = <e67cf1ce 962b62fe 0d679268 f224c7a4 173f580b 66f9f63f 38b2c20b 445491d5>;
        Recipe = <97384608 1da709dd a5f1192c 63074b0b 4b6023ca 19e4705f 85c6bed5 6942a700>;
        RecipeIngredient = <e9e982b1 cd01bb4b 83a914df 624f4b99 afbe5510 cc3cc123 2c2a7842 7736d632>;
        Type = <57ee301f 33d37fd1 f27309a0 cdb06f9f ac1747df 246a2420 eaf9e63c 4d0064d4>;
        UnitOfMeasure = <7ba6bde4 ed9b7866 51f38d9f f21d031d abf97c8c 149042cf 1bc3048b a2ace37b>;
    };
    NSStoreModelVersionHashesVersion = 3;
    NSStoreModelVersionIdentifiers =     (
    );
    NSStoreType = XML;
    NSStoreUUID = "80A5DD5F-A9F5-4C8D-82A4-76B22E65B63C";
}
2010-01-02 08:03:39.647 GrokkingRecipes[11205:a0f] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Failed to find source model
{
    NSPersistenceFrameworkVersion = 250;
    NSStoreModelVersionHashes =     {
        Author = <6666fad9 a6555ff4 bed5f65a e8e81ec7 980dd712 c420378a 239d1830 8a1ccd04>;
        Ingredient = <e67cf1ce 962b62fe 0d679268 f224c7a4 173f580b 66f9f63f 38b2c20b 445491d5>;
        Recipe = <97384608 1da709dd a5f1192c 63074b0b 4b6023ca 19e4705f 85c6bed5 6942a700>;
        RecipeIngredient = <e9e982b1 cd01bb4b 83a914df 624f4b99 afbe5510 cc3cc123 2c2a7842 7736d632>;
        Type = <57ee301f 33d37fd1 f27309a0 cdb06f9f ac1747df 246a2420 eaf9e63c 4d0064d4>;
        UnitOfMeasure = <7ba6bde4 ed9b7866 51f38d9f f21d031d abf97c8c 149042cf 1bc3048b a2ace37b>;
    };
    NSStoreModelVersionHashesVersion = 3;
    NSStoreModelVersionIdentifiers =     (
    );
    NSStoreType = XML;
    NSStoreUUID = "80A5DD5F-A9F5-4C8D-82A4-76B22E65B63C";
}'
*** Call stack at first throw:
(
	0   CoreFoundation                      0x92d1c40a __raiseError + 410
	1   libobjc.A.dylib                     0x91707509 objc_exception_throw + 56
	2   CoreFoundation                      0x92d1c138 +[NSException raise:format:arguments:] + 136
	3   Foundation                          0x92f31dc7 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 116
	4   GrokkingRecipes                     0x00005199 -[AppDelegate progressivelyMigrateURL:ofType:toModel:error:] + 543
	5   GrokkingRecipes                     0x00005c89 -[AppDelegate persistentStoreCoordinator] + 413
	6   GrokkingRecipes                     0x00005ea9 -[AppDelegate managedObjectContext] + 74
	7   Foundation                          0x92e72c7e -[NSObject(NSKeyValueCoding) valueForKey:] + 413
	8   Foundation                          0x92e765ac -[NSObject(NSKeyValueCoding) valueForKeyPath:] + 204
	9   AppKit                              0x90451c16 -[NSBinder _valueForKeyPath:ofObject:mode:raisesForNotApplicableKeys:] + 841
	10  AppKit                              0x90451841 -[NSBinder valueForBinding:resolveMarkersToPlaceholders:] + 188
	11  AppKit                              0x90451301 -[NSObjectParameterBinder _updateObject:observedController:observedKeyPath:context:] + 1400
	12  AppKit                              0x90450d81 -[NSObjectParameterBinder _observeValueForKeyPath:ofObject:context:] + 82
	13  AppKit                              0x904509f9 -[NSBinder _performConnectionEstablishedRefresh] + 85
	14  AppKit                              0x90443104 -[NSObject(NSKeyValueBindingCreation) bind:toObject:withKeyPath:options:] + 721
	15  AppKit                              0x904ef067 -[NSNibBindingConnector establishConnection] + 156
	16  AppKit                              0x9041e33b -[NSIBObjectData nibInstantiateWithOwner:topLevelObjects:] + 1249
	17  AppKit                              0x9041c450 loadNib + 257
	18  AppKit                              0x9041b848 +[NSBundle(NSNibLoading) _loadNibFile:nameTable:withZone:ownerBundle:] + 228
	19  AppKit                              0x9041b759 +[NSBundle(NSNibLoading) loadNibFile:externalNameTable:withZone:] + 158
	20  AppKit                              0x9041b6a4 +[NSBundle(NSNibLoading) loadNibNamed:owner:] + 383
	21  AppKit                              0x904184a9 NSApplicationMain + 434
	22  GrokkingRecipes                     0x00002c38 main + 30
	23  GrokkingRecipes                     0x00002bee start + 54
)

It seems to be complaining that it cannot find the source model, but it also seems to report having found my v3 data. @GrokkingRecipes_v3@ will open that datamodel without problems. @ProgressiveMigration@ won’t, of course, for reasons detail above.

What’s strange is that @ProgressiveMigration@ compiled correctly for me a couple of days ago. It was the subject of some confusion on my part, as you may remember from another post.

Please check the current code and compile it. If the problem is on my end, then I need to understand how I could be corrupting files in such a widespread fashion.

Avatarsmall_pragsmall
02 Jan 2010, 17:00
Marcus S. Zarra (284 posts)

The issue with spotlight and the multithread code samples has been resolved and I am working to get the updated code pushed up to PragProg.

For now you can download a copy from http://files.me.com/mzarra/muiyw3

Wedding photobooth_pragsmall
04 Mar 2010, 05:55
Tony Arnold (11 posts)

Marcus, what ended up being the issue with this example? I don’t see this error nearly at all, but I have one lone user reporting it right now (amongst thousands who don’t).

Avatarsmall_pragsmall
05 Mar 2010, 15:02
Marcus S. Zarra (284 posts)

The issue occurred because as I was writing the code samples I had updated the older versions of the app and their data models but did not update the mapping models. I had to go back through all of the samples and update the maps to match the changed models.

This of course would not happen in production because the older models would be static.

Generic-user-small
06 Mar 2010, 18:00
Jonathan Waddilove (11 posts)

Marcus, thank you for writing this book - it is a great help in consolidating my understanding of Core Data.

However, like others I am struggling to get the examples working. I started out keying the code from the hardcopy book (best way I know to drive home points you are illustrating) and I have fallen foul of the auto migration problems that others have raised.

I have now (re)downloaded the examples from the PragProg site and also your ‘work in progress’ amendments to multithread and spotlight examples. All seem to have the RecipeIngredientToRecipeIngredient errors in the mappingmodel. Worse (from my point of view) the errors seem to exist in the later examples like SyncServices.

I understand that you are working to fix these problems. But please, please, could you consider writing up some notes to help us work through these issues - perhaps even on you blog?

Avatarsmall_pragsmall
06 Mar 2010, 21:36
Marcus S. Zarra (284 posts)

Actually I thought I had resolved all of these inconsistencies in the last code push I did several months ago. I will look into this asap and do another code push. I will try to get to it within the next week.

Generic-user-small
07 Mar 2010, 18:48
Jonathan Waddilove (11 posts)

Thanks Marcus. Can we assume you’ll post here when you have had a chance to push the code? For what it’s worth I’m using xcode 3.2.2 on 10.6.2 - just in case the problems are affected by different versions of the tools.

Avatarsmall_pragsmall
07 Mar 2010, 19:03
Marcus S. Zarra (284 posts)

Yes, I will update this thread once I have resolved the issue and tested it thrice!

Generic-user-small
24 Jun 2010, 07:43
szucyq (3 posts)

Thanks.I have download the file from http://files.me.com/mzarra/muiyw3, while there is still a problem:when I build and run the project,there would be an alarm that “Failed to save.Unknown store type,format,or version”.Any suggestion?

Avatarsmall_pragsmall
22 Jun 2010, 15:27
Marcus S. Zarra (284 posts)

The link is dead. What subproject are you trying to compile?

I would also suggest downloading it directly from PragProg. That link was only temporary until Prag could get the latest code up.

Generic-user-small
24 Jun 2010, 06:51
szucyq (3 posts)

sorry, this link.http://files.me.com/mzarra/muiyw3

Generic-user-small
24 Jun 2010, 07:44
szucyq (3 posts)

I build the spotlight project.There is still a problem:when I build and run the project,there would be an alarm that “Failed to save.Unknown store type,format,or version”.Any suggestion?By the way,I want to make a project like Delicious Library.Does it use core data? I don’t know whether I should use core data.I have build and run the sample Spotlight but I don’t even see the spotlight place!Maybe you can help me.Thanks.

You must be logged in to comment