我想保存使用领域的图像的几个数组,但我不知道从哪里开始。我看过领域的文档和一些教程,但没有真正帮助我与我想做什么,我是新来的ios,所以我可能只是无法与他们说什么和我什么关系想做。我有什么是2个viewcontrollers与5个不同的数组,填充5个不同的collectionviews。我所做的所有研究都表明,我需要为我想要存储的数据创建数据模型,但是我不确定该怎么做,因为用户使用imagepickercontroller来存储图像。如果有人能指出我正确的方向,将不胜感激。如何保存与Realm图像阵列
到目前为止,香港专业教育学院尝试这样做:
//the class of vc1
class CViewController: UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate, UICollectionViewDelegate, UICollectionViewDataSource, ClosetDelegate, Object
//where i tried saving the array(im not sure if this works because of the error i get when i inherit 'Object')
override func viewDidDisappear(animated: Bool) {
let realm = Realm()
realm.write{
realm.add(array1)
}
}
我得到这个错误“从类多重继承的UIViewController和对象”当我试图继承“对象”