4

I have found a strange lines like:

id *_optimizationHints; <- in NSManagedObjectModel.h

id* _cd_snapshots; <- in NSManagedObject.h

id** _kvcPropertyAccessors; <- in NSEntityDescription

id* _debuggingRecords; <- in NSManagedObjectContext.h id *_cachedObsInfoByEntity; <- in NSManagedObjectContext.h

When i try to compile a project with ARC option, i see error like this: Pointer to non-const type 'id' with no explicit ownership

What's wrong? As i read from similar questions, i need to replace id * -> id

But this is Main CoreDate.Framework!

I can't understand this.

Can anybody explain this 'joke'?

2 Answers 2

4

I encounter similar issue this morning. Seems the problem is due to the Core Data has been built in somehow. When we import the CD framework, I have to go to Building Phases to add dependency framework instead of drag and drop directly from Finder. Hopefully this is helpful

2
  • not bad, i solved this problem too, but what is it? really strange 'joke' for developers? Aug 13, 2012 at 8:49
  • Same here. Instead of going to the target settings and adding CoreData.framework to the linked frameworks, I thought I had taken a shortcut by dragging & dropping from a second project. It appears that for whatever reason this does not work: I got the same 'pointer to non const' compile error. I fixed this by removing the drag&dropped version, and removing and re-adding the framework dependency the regular way. Don't know why this is any different, but it is. Thanks for this info!
    – ecotax
    Feb 5, 2013 at 16:45
4

I have run into the same problem today, while converting an existing project that I want to split into a static library and a public code part. I followed the instructions here: https://github.com/jverkoey/iOS-Framework

It is true that I added the CoreData.framework by dragging and dropping from my earlier project. However I deleted it and re-added it like you pointed out (mulitple times) but I still get the same errors that you reported.

EDIT: This was my problem: I deleted the frameworks and readded them from inside Xcode. My problem was that there actually was a "CoreData" subdirectory inside my project directory that wasn't deleted.

Solution: After deleting it in Finder, and re-adding it to the "Link Binary with Libraries" the problems went away

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.