On Feb 20, 2015, at 11:15 , Alex Kac <[email protected]> wrote:
>
> So with that in mind, has anyone tackled a conversion process of reading in
> UIColor data into NSColor via CoreData?
I suspect that *really* solving this is going to be impossible.
When you say “UIColor data”, do you mean the data resulting from archiving a
UIColor object, or did you use something else to put it in the CoreData store?
If it’s archived, you could try following the suggestion in the last response
in this thread:
http://stackoverflow.com/questions/3292836/create-uicolor-from-nscolor-data
<http://stackoverflow.com/questions/3292836/create-uicolor-from-nscolor-data>
That is to say, treat the raw data as a string, and then pick the components
out of the string.
The trouble you’re going to have is that a UIColor may not always be
represented as components, since some standard colors may have an arbitrary
enum—is representation. You also have to deal with possible alternate
representations that might have been saved by the iOS app running on older
versions of iOS. Even if you have components, you really need to match
colorspaces as well.
This makes me think you can get as far as getting NSColors that are at least
similar to the UIColors, though sometimes they may not be exactly the same.
_______________________________________________
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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]