I recently had to modify the data model of a project I didn't started. I just added the attribute "ordered" on some entities, and regenerated the whole thing in classes, about 10.
The issue is, I'm now constantly getting a SIBAGRT exception, and I cannot figure out why. It happens when I call the functions on my managed object, such as:
[currentArticle removePages:currentArticle.pages];
With this line I'm trying to empty an article from all its pages, at first I thought this might crash because there are no pages, so nothing to delete. So I turned this line into:
if ([currentArticle.pages count ] > 0){
[currentArticle removePages:currentArticle.pages];
}
It turned out that this specific line was not called anymore, but another generated function gave me the same SIBAGRT issue:
[currentAsset addMediasObject:currentMedia];
Both currentAsset and currentMedia are not null. po currentAsset gives
$2 = 0x08870c50 <Asset: 0x8870c50> (entity: Asset; id: 0x8870cb0 <x-coredata:///Asset/t6C0C3F05-8242-4889-90B0-DDF9A86EE16924> ; data: {
arrowColor = nil;
gallery = nil;
id = 0;
medias = (
);
name = "Couv-La-vie-en-rose";
page = nil;
parentGallery = nil;
style = "full-page";
type = picture;
value = "";
})
po currentMedia gives
$3 = 0x088778b0 <Media: 0x88778b0> (entity: Media; id: 0x8877910 <x-coredata:///Media/t6C0C3F05-8242-4889-90B0-DDF9A86EE16925> ; data: {
asset = nil;
"media_description" = "";
"media_uri" = "La-vie-en-rose.jpg";
"sub_uri" = "";
"thumbnail_uri" = "";
"video_id" = "Home_video_AH11";
})
It was perfectly working before I add the "ordered" attribute and regenerate the whole thing.
If anyone has a clue, that would be much appreciated.
Cheers!