If you have an Entity in Core Data, and you want to give it an 'image' attribute to store images, like your original question asks...Core Data is capable of storing NSData. All you need to do, is get a data representation of a UIImage instance and assign it to the attribute (in ObjC or Swift if you make an NSManagedObject subclass for the entity...which you definitely should do, assign the data to the NSData property).
As mentioned already in this thread, to get a NSData representation of a UIImage you can use the UIImagePNGRepresentation function.
| imageData = UIImagePNGRepresentation(existingUIImageObject) |
| |
| myCoreDataEntity.imageData = imageData |
Now, when to reconstitute the image data back as a UIImage to show in your user interface, when you get the entity back out of Core Data you can use the class method I mentioned above in my previous post. If you are using Swift, just write it using the Swift syntax instead of ObjC. Claire47 has it posted.
Far as your question related to UIPickerView..I recall that a bug was introduced in iOS 7 that caused UIImageViews, when used inside a UIPickerView to not appear. I haven't tried to use UIPickerView with images in it in a long time, but it did break one of my apps years ago, and forced me to rewrite it using a UIPickerView clone. I have no idea if Apple has fixed that bug from iOS 7.