Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 265 Vote(s) - 3.52 Average
  • 1
  • 2
  • 3
  • 4
  • 5
'NSKeyedUnarchiveFromData' should not be used to for un-archiving and will be removed in a future release

#1
I'm receiving a message in the log saying

> 'bundleNamePlaceholder'[8424:100146] [general]
> 'NSKeyedUnarchiveFromData' should not be used to for un-archiving and
> will be removed in a future release

The message is not clear to me but I'm assuming that it might be something related to a CoreData object or maybe its content

Is there a way to catch what's throwing this message or what might cause it?
Reply

#2
Easiest solution for saving UIColor to CoreData that worked for me:

1. Create class in new file:

import Foundation
import UIKit

class ColorTransformer: NSSecureUnarchiveFromDataTransformer {
static let name = NSValueTransformerName(rawValue: "ColorTransformer")

override static var allowedTopLevelClasses: [AnyClass] {
return [UIColor.self]
}

public static func register() {
let transformer = ColorTransformer()
ValueTransformer.setValueTransformer(transformer, forName: name)
}

static func registerTransformer() {
let transformer = ColorTransformer()
ValueTransformer.setValueTransformer(transformer, forName: name)
}
}


2. add to didFinishLaunchingWithOptions in AppDelegate:

ColorTransformer.register()


3. in .xcdatamodel > problematic atribute > Data Model Inspector > Transformer - "ColorTransformer"
Reply

#3
For me the issue was from GoogleAnalytics framework, thanks to @Lutz I could figure it out. For those facing issue from GA please use the updated sdk, this issue seem to be resolved
[GA SDK][1]


[1]:

[To see links please register here]

Reply

#4
In my case the problem was in using `Transformable` type in CoreData for saving array of strings. By default CoreData uses `NSKeyedUnarchiver` instead of `NSSecureUnarchiveFromData` transformer. So changing the transformer solved this problem.

[![enter image description here][1]][1]


[1]:
Reply

#5
Usually this is related to Core Data Transformable attributes however in my case this was also caused by an external library which was using `NSValueTransformer.valueTransformerNames` to iterate over all value transformer classes available in runtime. This was also causing the same errors in logs and symbolic breakpoints given in other answer here did not catch them. So if you cannot find a reason why you have this logs you might also want to search for `NSValueTransformer` in your code and check if there isn't a similar problem somewhere.
Reply

#6
To find out what is causing these log messages, try adding symbolic break points for

`+[NSKeyedUnarchiver unarchiveObjectWithData:]`,

`+[NSKeyedUnarchiver unarchiveTopLevelObjectWithData:error:]`, and

`+[NSKeyedUnarchiver unarchiveObjectWithFile:]`

This helped me finding the culprit.
Reply

#7
apple is removing `NSKeyedUnarchiveFromData` at some point because it's not secure by default. if you're storing a transformable value using `NSKeyedUnarchiveFromData` in coredata, it will then become unreadable.

[To see links please register here]


and

[To see links please register here]

Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through