• 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
@dynamic and Programmatic Access to Setters
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

@dynamic and Programmatic Access to Setters


  • Subject: @dynamic and Programmatic Access to Setters
  • From: Mike Rossetti <email@hidden>
  • Date: Thu, 17 Apr 2008 21:15:58 -0600

I'm a bit confused by @dynamic and hoping there's a simple explanation.

My little project has a data model and a custom class (Tip) for one of the classes in the model. The Tip interface defines the attributes, one of which is:

   @property (retain) NSString *tipName;

Tip's implementation has:

   @dynamic tipName;

Everything works swell with bindings, the UI is fully functions, the file saves -- happiness.

Then I add a class method that creates a new Tip and tries the following assignment (two approaches shown):

   newTip.tipName = @"FUBAR";
   [newTip setTipName:@"FUBAR"];

Both cause a runtime error:

   -[tip setTipName:]: unrecognized selector sent to instance

Bindings clearly work so I'm surprised the setTipName isn't synthesized and available for my use.

Choosing the attribute in the model and the "Copy Obj-C 2.0 Method Implementations to Clipboard" shows the following words:

* You do not need any of these.
* These are templates for writing custom functions that override the default CoreData functionality.
* You should delete all the methods that you do not customize.
* Optimized versions will be provided dynamically by the framework.


I don't want to customize the default functionality, I just want to access it.

Hint?

Thanks,
Mike

_______________________________________________

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: @dynamic and Programmatic Access to Setters
      • From: Jens Alfke <email@hidden>
    • Re: @dynamic and Programmatic Access to Setters
      • From: Quincey Morris <email@hidden>
    • Re: @dynamic and Programmatic Access to Setters
      • From: Jack Repenning <email@hidden>
  • Prev by Date: Re: Why is [nil aMessage] a no-op?
  • Next by Date: Re: @dynamic and Programmatic Access to Setters
  • Previous by thread: PageView with NSTextView?
  • Next by thread: Re: @dynamic and Programmatic Access to Setters
  • Index(es):
    • Date
    • Thread