• 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: Using isMemberOfClass with a tree of subclass of NSManagedObject
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using isMemberOfClass with a tree of subclass of NSManagedObject


  • Subject: Re: Using isMemberOfClass with a tree of subclass of NSManagedObject
  • From: Bill Bumgarner <email@hidden>
  • Date: Sat, 28 Jun 2008 11:14:44 -0700

On Jun 28, 2008, at 10:58 AM, Yoann GINI wrote:
@interface root :  NSManagedObject
@interface song :  root
@interface artist :  root
@interface modification :  NSManagedObject

Obj-C classes start with a capital letter, by convention. So -- Root, Song, Artist, and Modification would be standard.


-(void)dataBaseHaveChange:(NSNotification*)notification //I receive here the notification of a CoreData modification
{
NSNotification* userInfo = [[notification userInfo] retain];

No need to -retain the userInfo.


NSSet* objectsSet = nil; objectsSet = [userInfo valueForKey:NSInsertedObjectsKey];

You want -objectForKey: -valueForKey: is for key value coding, - objectForKey: is for extracting objects from a dictionary.


Shouldn't cause a problem.


for (NSManagedObject* modEntry in objectsSet) {

Are you sure objectsSet contains any objects?


if ([modEntry isKindOfClass:[root class]]) { //do something } }

b.bum

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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: Using isMemberOfClass with a tree of subclass of NSManagedObject
      • From: "Kyle Sluder" <email@hidden>
References: 
 >Using isMemberOfClass with a tree of subclass of NSManagedObject (From: Yoann GINI <email@hidden>)
 >Re: Using isMemberOfClass with a tree of subclass of NSManagedObject (From: "Owen Yamauchi" <email@hidden>)
 >Re: Using isMemberOfClass with a tree of subclass of NSManagedObject (From: Yoann GINI <email@hidden>)
 >Re: Using isMemberOfClass with a tree of subclass of NSManagedObject (From: Mike Abdullah <email@hidden>)
 >Re: Using isMemberOfClass with a tree of subclass of NSManagedObject (From: Yoann GINI <email@hidden>)

  • Prev by Date: Re: Style Question (Robert Claeson)
  • Next by Date: Re: [SOLVED] noob question regarding proxy object returned by -selection method of NSArrayController
  • Previous by thread: Re: Using isMemberOfClass with a tree of subclass of NSManagedObject
  • Next by thread: Re: Using isMemberOfClass with a tree of subclass of NSManagedObject
  • Index(es):
    • Date
    • Thread