• 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: Dynamic Method Creation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dynamic Method Creation


  • Subject: Re: Dynamic Method Creation
  • From: Steve Steinitz <email@hidden>
  • Date: Sat, 15 Sep 2012 19:27:24 +1000

Hi Kyle,

Thanks for your reply.

On 15 Sep 12, at 7:02pm, Kyle Sluder wrote:

> A shift is an object with a known number of instances per employee. You've those instances and splayed out thir properties as methods on the employee.

Yes.  I've "splayed" them because cocoa sometimes throws "cannot remove observer..." if you bind a value to x.y.z.   That is bad in a production environment because of  the disastrous state in which "cannot remove observer..." leaves the app.  So I always make special "binding methods", "xyz" which return x.y.z  Its a pain but "cannot remove observer..." is worse.

Enough on that now please.

> It would be far easier to have a -[Employee shiftForDayOfWeek:] method that returns a Shift instance, and put all your shift-specific properties on that object.

True, and that's exactly what I've done.  You can see the call to that method in my Monday methods.

Guys, I'd like to keep this thread focused on Dynamic Method Creation rather than my design deficiencies, especially since the thread has actually borne fruit in the form of of Jean's helpful technique.  OK?  Perhaps you could rake me over the coals off list?

Cheers,

Steve
_______________________________________________

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 Method Creation
      • From: Jens Alfke <email@hidden>
References: 
 >Dynamic Method Creation (From: Steve Steinitz <email@hidden>)
 >Re: Dynamic Method Creation (From: Ken Thomases <email@hidden>)
 >Re: Dynamic Method Creation (From: Steve Steinitz <email@hidden>)
 >Re: Dynamic Method Creation (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Re: NSColor contrasting color?
  • Next by Date: choosing colors
  • Previous by thread: Re: Dynamic Method Creation
  • Next by thread: Re: Dynamic Method Creation
  • Index(es):
    • Date
    • Thread