• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Many-To-Many Relationship Interface in Core Data
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Many-To-Many Relationship Interface in Core Data


  • Subject: Re: Many-To-Many Relationship Interface in Core Data
  • From: "Frank D. Engel, Jr." <email@hidden>
  • Date: Fri, 27 Apr 2007 16:30:46 -0400

I think you'll find I'm not one to give up easily!

Thank you, I must have read those memory rules several times and still made that mistake...

After fixing that (retaining the objects), I still had the same problem. I took some time to do a bit of debugging, and here is what I came up with:

I have an array controller on the "restrictions" table which I was querying for a selected object.

Since no object existed at the time, this was returning an empty array.

The empty array worked through some circles and eventually led to those errors.

By adding special handling for the empty array, this particular problem was solved.

I still need to fix some other things, but I'm starting to get a better feel for some of this.

I will probably come up with more questions before this is finished, but now that I'm past this hurdle (and discovered NSLog), I'm feeling a bit more confident of this.


Thank you for all of the help!



On Apr 26, 2007, at 9:33 PM, mmalc crawford wrote:


On Apr 26, 2007, at 5:09 PM, Frank D. Engel, Jr. wrote:

malloc: *** Deallocation of a pointer not malloced: 0xbfffd8a0; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug
But I don't do any retain (should I? I am setting these as member variables of the class, and using them in the other methods later on), release, malloc, free, etc...


For a summary of memory management rules, see <http:// developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/Tasks/ MemoryManagementRules.html>;
the enclosing document gives a full treatment.



restrictions = [NSEntityDescription entityForName:@"Restriction" inManagedObjectContext:ctx];
qualifiers = [NSEntityDescription entityForName:@"Qualifier" inManagedObjectContext:ctx];
[...]

But I don't do any retain (should I? I am setting these as member variables of the class, and using them in the other methods later on), release, malloc, free, etc...


You should almost certainly be retaining these values, but "indirectly" using accessor methods -- see the references given above.


I'm sorry if any of this seems obvious, but I'm still learning Cocoa while trying to do this!

You are *strongly* discouraged from using Core Data (and even bindings) until you have mastered the fundamentals of Cocoa. These technologies give a high level of abstraction that makes problem- solving difficult or impossible if you do not understand the basics upon which they are built.

mmalc





_________________________________________________________________ Need personalized email and website? Look no further. It's easy with Doteasy $0 Web Hosting! Learn more at www.doteasy.com _______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Many-To-Many Relationship Interface in Core Data
      • From: mmalc crawford <email@hidden>
References: 
 >Many-To-Many Relationship Interface in Core Data (From: "Frank D. Engel, Jr." <email@hidden>)
 >Re: Many-To-Many Relationship Interface in Core Data (From: mmalc crawford <email@hidden>)
 >Re: Many-To-Many Relationship Interface in Core Data (From: "Frank D. Engel, Jr." <email@hidden>)
 >Re: Many-To-Many Relationship Interface in Core Data (From: mmalc crawford <email@hidden>)

  • Prev by Date: Re: 'dragging Entered' never called
  • Next by Date: Re: Many-To-Many Relationship Interface in Core Data
  • Previous by thread: Re: Many-To-Many Relationship Interface in Core Data
  • Next by thread: Re: Many-To-Many Relationship Interface in Core Data
  • Index(es):
    • Date
    • Thread