Re: NSCoding, objects that can
Re: NSCoding, objects that can
- Subject: Re: NSCoding, objects that can
- From: Rob Rix <email@hidden>
- Date: Tue, 23 Dec 2008 13:55:33 -0500
-conformsToProtocol will do it:
for(id object in [dictionary objectEnumerator]) {
if(![object conformsToProtocol: @protocol(NSCoding)]) {
// raise an exception, exclude the object, or whatever
}
}
Rob
On 23-Dec-08, at 1:47 PM, Alexander Cohen wrote:
Hi, i have a class that contains an NSDictionary. That dictionary is
encoded in encodeWithCoder:. Once in a while, a user might put in
something liek a CGColorSpaceRef or something similar and everything
stops working. Is there a way to find out if bjects in the
dictionary can actually be encoded. Keep in mind that they might not
always be Obj-C objects. I guess i'm looking for a
ObjecTypeCanBeEncoded method or something like that.
thx
AC
_______________________________________________
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
_______________________________________________
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