Why does core data trims string values?

Home / Uncategorized / Why does core data trims string values?

Question:
I am using Core data. One of my NSManagedObject has a string property which stores the document directory path. When I see my DB in SQLite browser, I see the full link.

But when I fetch, it is trimmed. My sort descriptor is only using a time based sorting, nothing else.

Here is the fetch:NSFetchRequest *fetchDrafts = [[NSFetchRequest alloc] initWithEntityName:@"DraftPost"];

NSSortDescriptor *sortViaDate = [NSSortDescriptor sortDescriptorWithKey:@"timestamp" ascending:NO];

fetchDrafts.sortDescriptors = @[sortViaDate];

NSError *fetchDraftsError = nil;

[_offlinePostsArray addObjectsFromArray:[[[AppStateManager sharedInstance] applicationDBContext] executeFetchRequest:fetchDrafts error:&fetchDraftsError]];
Value in DB: /Users/rikon/Library/Developer/CoreSimulator/Devices/F2271001-04C5-46E6-9C29-DBD63E509BDF/data/Containers/Data/Application/0BF8855B-CF43-4F7C-B50C-12C907E0BEC6/Documents/tame_app_data/post_drafts/draft_1502455298.mp4

Value in the fetched object: /Users/rikon/Library/Developer/CoreSimulator/Devices/F2271001-04C5-46E6-9C29-DBD63E509BDF/data/Containers/Data/Application/0BF8855B-CF43-4F7C-B50C-12C907E0BEC6/Documents/tame_app_data/post_drafts/dra


Answer:

Read more

Leave a Reply

Your email address will not be published. Required fields are marked *