• 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: typedef show up as existing type while introspecting, want to show defined data type
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: typedef show up as existing type while introspecting, want to show defined data type


  • Subject: Re: typedef show up as existing type while introspecting, want to show defined data type
  • From: Graham Cox <email@hidden>
  • Date: Sun, 04 Sep 2011 19:03:29 +1000

On 04/09/2011, at 5:23 PM, Devraj Mukherjee wrote:

> Is there a way that I can ask property_getAttribute to return the
> defined names not the parent names?


No, as per the other reply.

>
> Subclassing is my only other option to solve my problem but I want to
> refrain from doing that for core Obj-C types.


Of course it's not your only other option.

Asking for types in this way in an object-oriented environment really is a bad code smell. There's almost certainly an easier/more straightforward way to achieve whatever your actual goal is, but taking it at face value, just make a composite object:

@interface TypedObject: NSObject
{
    id     			theObject;
    NSString*   	theType;
}

- (id) initWithObject:(id) object ofType:(NSString*) type;

- (NSString*) type;
- (id)		object;

@end

It still stinks, but it's at least clean.

--Graham


_______________________________________________

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

References: 
 >typedef show up as existing type while introspecting, want to show defined data type (From: Devraj Mukherjee <email@hidden>)

  • Prev by Date: Re: Knowing when font panel is visible
  • Next by Date: Re: Knowing when font panel is visible
  • Previous by thread: Re: typedef show up as existing type while introspecting, want to show defined data type
  • Next by thread: keylayout in Lion
  • Index(es):
    • Date
    • Thread