Releasing Core Data Model File iVars
I am using Core Data for the first time. I created an entity called "Channel". The tutorial I was using also created a "Model File" for each entity. So it is like an object (class) called "Channel" which declares the attributes as ivars, and then retains them with @property. Now in the .m file, instead of synthesizing them, @dynamic iVars was used. Now obviously, since I开发者_Python百科 am retaining and not releasing, the code leaks. I tried writing a dealloc method, but it does not work. It says "Use of undeclared identifier "ivar name"".
What is the problem here? Is creating a "Model File" even necessary when using Core Data? If so, why is that? And how would I release those variables?
Thanks,
Problem is somewhere else not in your core data object. Still if you have doubt on that class then just create object for that class, use it for core data manipulation and release it in the same scope. Try this and give your feedback.
Happy Coding..!
Normally Core Data is responsible for the life cycle of all modeled properties of a managed object. If you add your own iVars that do not have corresponding properties in the managed object, then you have to manage those by yourself as normal.
hope this helps!!
精彩评论