1

I have a NSMutableArray full of a custom object called CHClipboardObject I need to save this array to core data so I can use it to populate a UITableView. I have looked around on how to do this and this is what I've got so far.

Create class called something like ArrayData with one property to hold the NSMutableArray

Serialize/conform to NSCoding my CHClipboardObject which I am not sure how to do.

What do I need to do after these steps?

I need to be able to delete objects in the array from the UITableView by swiping, which I have already implemented.

1
  • Make CHClipboardObject as an entity in the model and then show the same in table view using NSFetchResultsController? Commented May 27, 2014 at 13:10

1 Answer 1

1

1) Set the type to "Transformable"

enter image description here

2) Implement methods

-(id)initWithCoder:(NSCoder *)aDecoder
-(void)encodeWithCoder:(NSCoder *)encoder

on your custom object

3) You are ready to go!

Sign up to request clarification or add additional context in comments.

2 Comments

Would I implement the methods in my CHClipboardObject or ClippingData?
You need to implement that methods on Array element (which are the elements of the array)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.