Text

Certificate Register Error in Swift

I am going to use SingleLineWidget of Text.

let certificate = NSData(bytes: myCertificate.bytes, length: myCertificate.length)
let isRegistered = singleLineWidget.registerCertificate(certificate as Data!) as! Bool

Then this code crashes at second line code.

2016-12-07 16:05:35.548 Nurse[4930:293061] +[UIImage resourcesBundleImageNamed:]: unrecognized selector sent to class 0x37c78f8
2016-12-07 16:05:35.570 Nurse[4930:293061] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[UIImage resourcesBundleImageNamed:]: unrecognized selector sent to class 0x37c78f8'
*** First throw call stack:

How can I solve this?

I tested in SingleLineWidget Sample with this certificate. but sample works well.


Dear Cameron,

unfortunately, the above log doesn't help much.

Can you please try as in the following link: https://developer-support.myscript.com/support/discussions/topics/16000007817

Best regards,

Olivier

Hi, Olivier, thanks for your support.

Then I already imported all modules using Briding header file.

let isRegistered = singleLineWidget.registerCertificate(certificate as Data!) as! Bool

Then In this code, I got bellow error.

2016-12-11 11:23:50.522 Nurse[24179:2302477] +[UIImage resourcesBundleImageNamed:]: unrecognized selector sent to class 0x37bc8f8
2016-12-11 11:23:50.641 Nurse[24179:2302477] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[UIImage resourcesBundleImageNamed:]: unrecognized selector sent to class 0x37bc8f8'
*** First throw call stack:
(
 0 CoreFoundation 0x01833212 __exceptionPreprocess + 194
 1 libobjc.A.dylib 0x012ebe66 objc_exception_throw + 52
 2 CoreFoundation 0x018ac2ec +[NSObject(NSObject) doesNotRecognizeSelector:] + 172
 3 CoreFoundation 0x017b234c ___forwarding___ + 1052
 4 CoreFoundation 0x017b1f0e _CF_forwarding_prep_0 + 14
 5 Nurse 0x00306cef -[SLTWSingleLineWidget initCommon] + 1386
 6 Nurse 0x00307e3a -[SLTWSingleLineWidget registerCertificate:] + 187
...
}

how can I resolve this?

Dear Cameron,

unfortunately, such logs don't help. Can you please provide us with a sample that allows to reproduce?

Best regards,

Olivier

I fixed this error.

I missed to set Linker Flag in build setting.

Thanks Olivier.

Dear Cameron,

I am glad it is working.

Let us know if you have other questions.

Best regards,

Olivier

Login or Signup to post a comment