• 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: Adding Properties to NKIssue?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Adding Properties to NKIssue?


  • Subject: Re: Adding Properties to NKIssue?
  • From: Conrad Shultz <email@hidden>
  • Date: Wed, 04 Jul 2012 18:30:23 -0700

On 7/4/12 2:27 PM, Dave wrote:
> Hi,
>
> That's more or less what we have at the moment and I think it's just
> fine and probably better in the long run. However someone else thinks it
> would be a better idea to do it my extending NKIssue if it is possible,
> but it seems it's not, since there is no way I can see of actually
> storing the property value anywhere, since you can't add iVar's.

A workaround in situations where you need to add storage is to use
associated objects.

See
http://developer.apple.com/library/ios/#documentation/cocoa/conceptual/objectivec/Chapters/ocAssociativeReferences.html
and the Objective-C run-time reference for details.

It's really quite easy, and since NKIssue is only in iOS 5 and newer you
don't have any backward compatibility issues.

Note that you will need to import <objc/runtime.h> for the functions.

--
Conrad Shultz

Synthetiq Solutions
www.synthetiqsolutions.com
_______________________________________________

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: Adding Properties to NKIssue?
      • From: Charles Srstka <email@hidden>
References: 
 >Adding Properties to NKIssue? (From: Dave <email@hidden>)
 >Re: Adding Properties to NKIssue? (From: Nick Zitzmann <email@hidden>)
 >Re: Adding Properties to NKIssue? (From: Dave <email@hidden>)
 >Re: Adding Properties to NKIssue? (From: Fritz Anderson <email@hidden>)
 >Re: Adding Properties to NKIssue? (From: Dave <email@hidden>)

  • Prev by Date: Re: Crash when calling va_arg()
  • Next by Date: Re: Adding Properties to NKIssue?
  • Previous by thread: Re: Adding Properties to NKIssue?
  • Next by thread: Re: Adding Properties to NKIssue?
  • Index(es):
    • Date
    • Thread