Pat_Morita
Pat_Morita

Reputation: 3535

NSMutableDictionary content objects comply to NSCopying protocol

I am on objective-c, macOS.

I have an options Dictionary declared like this

@property NSMutableDictionary* options

Now the object containing the dictionary needs to be copied with copyWithZone including the options.

I can invoke "copy" on the dictionary. But how do i make sure that every object added to the dictionary (which basically can be any kind of object), complies to the NSCopying Protocol?

Something like

@property NSMutableDictionary* <NSCopying> options

Can i add something to the property declaration (that i didn't find out yet) or do i need to subclass NSDictionary (which i most likely want to avoid)

Regards

Pat

Upvotes: 0

Views: 37

Answers (0)

Related Questions