Swift PDFView issue: .notdef: no mapping - swift

I get odd error messages with PDFView from PDFKit.
In some instance I get
non-isolated groups aren't supported.
Mutating glyph 1 (code 32) in ULBEWJ+MinionPro-Regular.
In another instance I get the message:
.notdef: no mapping.
In most PDF's I display I get no error messages.
The same for all PDFs is that they're all shown correctly in simulator.
Does this has something to do with UTF?
Any idea how to fix those error messages?

Related

Realm Migration Swift

I added a new Class ,newClass, to my Realm file through Realm Studio to allow users to manage an array of items. I also created swift file to manage the new class in XCode.
Since running the app immediately after doing the above, all my data from the firstClass, has disappeared (not a problem the user adds all data in this class on startup, I can repopulate whilst testing the app.)
My app now crashes whenever it reaches any code let realm = try! Realm(). I have commented out or removed references to these to see if it is a localised problem, but it still continuous to crash with the following similar errors depending on the VC it crashes on when during let realm = try! Realm().
schema version 1
Fatal error: 'try!' expression unexpectedly raised an error: Error Domain=io.realm Code=1 "Provided schema version 0 is less than last set version 1." UserInfo={NSLocalizedDescription=Provided schema version 0 is less than last set version 1., Error Code=1}: file /Users/UserName/Desktop/AppName/AppName/Custom VC's/AddDataToRealmViewController.swift, line 168
2020-06-27 13:23:10.481817+0100 AppName[4498:173994] Fatal error: 'try!' expression unexpectedly raised an error: Error Domain=io.realm Code=1 "Provided schema version 0 is less than last set version 1." UserInfo={NSLocalizedDescription=Provided schema version 0 is less than last set version 1., Error Code=1}: file /Users/UserName/Desktop/AppName/AppName/Custom VC's/AddDataToRealmViewController.swift, line 168
After doing a little bit of reading around, it suggest I need to migrate my realm file to the new schema? Before I attempt this, would this be the correct course of action to take?

How can I get unacked messages in rabbitmq in swift language?

In java, I'm getting unacked messages with channel.basicRecover(true), Is there anything like this in swift?
I'm also getting this error when I use channel.recover() in swift version.
allocator = <RMQMultipleChannelAllocator: 0x15c7f28a0>>
error: Error Domain=com.rabbitmq.rabbitmq-objc-client Code=8 "Expected RMQChannelOpenOk, got (null)."
UserInfo={NSLocalizedDescription=Expected RMQChannelOpenOk, got (null).}
channel.recover() is really a private API for doing automatic connection recovery. We've recently documented this here: https://github.com/rabbitmq/rabbitmq-objc-client/blob/master/RMQClient/RMQChannel.h#L98
We currently don't have basicRecover support, like Java. If you have a use for it, please file an issue: https://github.com/rabbitmq/rabbitmq-objc-client/issues

Is there a list of MPMoviePlayer error codes

if a movie finishes with an error, then I might get an error like:
Error Domain=MediaPlayerErrorDomain Code=-12847 "This movie format is
not supported."
The same description is used for different error codes - but I can't find the code definitions anywhere.
Are they available?
Here you go. https://developer.apple.com/library/mac/#documentation/AVFoundation/Reference/AVFoundation_ErrorConstants/Reference/reference.html
God help you if your code (like mine) was -11800 (AVErrorUnknown).

AVAudioPlayer initialization: error code -50

I recently ran into a problem that I couldn't find discussed anywhere on the internet - I was initializing an AVAudioPlayer to play an audio file, and getting the following error:
Error Domain=NSOSStatusErrorDomain Code=-50 "Operation could not be completed. (OSStatus error -50.)
As it turns out, I had made a mistake creating my NSURL to send to the audio player init method, resulting in the NSURL object being null. Stupid mistake, pretty easy to find when debugging, but I thought I'd list it here just in case someone else does the same thing.
“ OSStatus error -50” means paramErr, an old-style Mac error code indicating a bad parameter.
Regarding the comment from Brynjar:
The Apple NSURL Class Reference describing URLWithString states
To create NSURL objects for file system paths, use
fileURLWithPath:isDirectory: instead.
I have found that using URLWithString for file system paths generates the error reported by pix0r and therefore could be another explanation for error code = -50
Make sure your NSURL is valid, or you will get error code -50 "Operation could not be completed".
I'm adding my version of the issue and solution because I encountered the error with a print statement. I think it was related to string interpolation and or trying to forcibly print nsattributedstrings. I attempted to do the following.
print("THE ARRAY COUNT IS : \(unwrappedResults.count)\n\n\n
THE FULL ARRAY IS THE FIRST WHOLE RESULT IS: \(unwrappedResults)\n\n\n \ (unwrappedResults[0])\n
THE ATTRIBUTED FULL TEXT IS: \(unwrappedResults[0].attributedFullText)\n\n\n
THE ATTRIBUTED PRIMARY TEXT IS: \(unwrappedResults[0].attributedPrimaryText)\n\n\n
THE ATTRIBUTED SECONDARY TEXT IS: \(unwrappedResults[0].attributedSecondaryText)\n\n\n")
something about this was incorrect and no print would occur. I would receive the error following errors in my console.
boringssl_metrics_log_metric_block_invoke(131) Failed to log metrics
&
boringssl_metrics_log_metric_block_invoke(133) Error Domain=NSOSStatusErrorDomain Code=-50 "Unsupported xpc type"
UserInfo={NSDescription=Unsupported xpc type}
I fixed this issue by changing the way I unwrapped/the variables values. Fundamentally I think I was trying to print something using string interpolation that could not be printed and that is what caused this error.

iPhone Objective-C JSON Parser

Has anyone had issues with a size limit on a returned JSON Object using the JSON Parser that is available for the iPhone?
I am using this open-source JSON Framework (I am using the latest version)
If I reduce the size of the returned JSON my app will run just fine. If the object gets too large, the app crashes with the below error:
-JSONValue failed. Error trace is: (
Error Domain=org.brautaset.JSON.ErrorDomain Code=3 UserInfo=0x4141580 "Unrecognised leading character"
Don't be fooled though... it has nothing to do a leading character except that it seems to split the JSON at a certain size and then ends up with a random leading character because the next JSON string starts with a random character.
Looks like I was wrong. I was trying to parse the JSON in a didReceiveData callback method, which gets called multiple times as data is received. I needed to concatenate the result as it came in and then parse the JSON in connectionDidFinishLoading.
Thanks for looking.