Re: typedef show up as existing type while introspecting, want to show defined data type
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