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 protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to