• 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: Creating Core Data Accessor Methods : Doesn't work?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating Core Data Accessor Methods : Doesn't work?


  • Subject: Re: Creating Core Data Accessor Methods : Doesn't work?
  • From: Jerry Krinock <email@hidden>
  • Date: Fri, 20 Sep 2013 10:54:24 -0700

On 2013 Sep 19, at 16:23, Keary Suska <email@hidden> wrote:

> I am not sure about the help but the Core Data docs are certainly wrong or misleading. AFAIK, you can only paste the property declarations and the @dynamic directives using that method. Starting in v.4 there is a method to create source files, but I haven''t tried that to see what it creates. I would be surprised if it does anything more...

Thank you, Keary.  Oddly, I tried it again today, several times, and now instead of menu item

  Paste Attribute Name

I now get

  Paste Attribute Implementation

or

  Paste Relationship Implementation

but it's still no good, because all it pastes is

@dynamic Foo ;

Well, strictly speaking, this is an "implementation", so I can't file a bug saying that it doesn't work.

But what I want is a "customizable implementations" such as were generated by Xcode 3, for example,

- (void)setFoo:(id)newValue  {
    [self willChangeValueForKey:@"foo"] ;
    [self setPrimitiveFoo:newValue] ;
    [self didChangeValueForKey:@"foo"] ;

    // Your code here…
}

and friends.  For relationships it's way more complicated; there are 5 or 6 methods I can never remember.

Apparently Apple has decided to remove that feature, re-opening the field to third-party tools which, last time I checked, can still do this…

http://www.kevincallahan.org/software/accessorizer.html
https://github.com/rentzsch/mogenerator

Or sometimes it's easier to use KVO and put your code in the observer method instead of custom accessors.

Jerry
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


References: 
 >Creating Core Data Accessor Methods : Doesn't work? (From: Jerry Krinock <email@hidden>)
 >Re: Creating Core Data Accessor Methods : Doesn't work? (From: Keary Suska <email@hidden>)

  • Prev by Date: Re: Library Include Questions
  • Next by Date: Re: Storyboard's in Interface Builder in XCode 4.6.3
  • Previous by thread: Re: Creating Core Data Accessor Methods : Doesn't work?
  • Next by thread: Target Dependencies order
  • Index(es):
    • Date
    • Thread