ios - Capturing Signature to Core Data -


I have an app that creates a field to sign the name of the user. When I click on save signature, I want to create an image, save it as a PNG, and save it in core data.

With the image of the "Pilot Signature" property, this is your unit.

  - Signature to save (IBAction): (ID) sender) {NSData * ImageData = UIMJPNGRAPanation (MySignat.IJEge); // Create an image object for the new image. NSManagedObject * image = [NSEntityDescription insertNewObjectForEntityForName: @ Managed Object Contains in "Image": self.managedObjectContext]; Self.mySignatureImage = imageData; // Set the image for the image-managed object [Image Set Value: Image of: @ "PilotSignature Image"]; }  

When I saveSignature

Expected Methodist Body

And I get on the self.MySignature.image line

Incompatible type assigned to "UIImageView" from "NSManagedObject"

I I have looked at similar posts about how the image was saved in core data, and I have no luck what I have done differently.

Any help would be appreciated

There are serious problems with this code. Firstly, this line is not a valid purpose:

  - Signature to save (IBAction): (ID) sender) {  

that last ) should not be there. This is probably an "expected method body" error, because you are confusing the compiler

There is no self.MySignature.image line. I think that you mean the line to self.myS IgnatureImage .

  self.mySignatureImage = imageData;  

What is this error saying that it is self.mySignatureImage a UIImageView but that is imageData is a NSManagedObject . You can not specify one of them, because they are completely unrelated things. Perhaps you wanted to type self.mySignature.image instead, because you mentioned in your question?

In the end, this line does not make any sense:

  [image set value: image of: @ "pilot signature image"];  

You are assigning a image as your own attribute. It should be incorrect that you enter imageData Want to assign here?

I'm assuming that the last few lines should look like this, but this is not possible with some questions:

  self. MySignature.image = imageData; [Image Set Value: ImageData for: @ "PilotSignature Image"];  

With this question and other related questions you have asked, I think that you would love to review some of the basic things of Objective-C. You have basic problems which are straight core Data or images are not related to handling.


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -