If an app is rated 4+, does it have any additional obligation due to the SB2420 beyond this rating on the AppStore ?
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I used to resize images (editing width and height when writing the post) in order to avoid ridiculously large images in reading published post.
Since a few weeks, that does not work anymore.
When I edit, I see the reduced size in Live Preview:
But once posted, images are much larger as seen below:
Looks like the image is now resized to fill full width.
I filed a bug report: Dec 27, 2025 at 1:43 PM – FB21446929
PS: that change ignores @eskimo wise advice "Quinn’s Top Ten DevForums Tips" n°10 (https://developer.apple.com/forums/thread/706527).
I got accidentally this graph whilst playing with the periods of display in AppStoreConnect Trends
hourly graph
on several days
But when I try to recall it, no way. If I select a multi days period, hourly graph is not available.
Someone has an idea how to get it again ? Or was I lucky to profit of a forums bug ?
Here are the settings for the graph I cannot select again.
I have a large code that I try to update to change deprecated APIs.
In the former version, I used forWritingWith and forReadingWith
let data = NSMutableData()
let archiver = NSKeyedArchiver(forWritingWith: data)
archiver.encode(myObject, forKey: theKey)
if let data = NSMutableData(contentsOf: anURL) {
let unarchiver = NSKeyedUnarchiver(forReadingWith: data as Data)
let myObject = unarchiver.decodeObject(forKey: theKey) as! TheObjectType // <<-- returns the object
That I changed to
let data = NSMutableData()
let archiver = NSKeyedArchiver(requiringSecureCoding: true)
archiver.encode(myObject, forKey: theKey)
if let data = NSMutableData(contentsOf: anURL) {
do {
let unarchiver = try NSKeyedUnarchiver(forReadingFrom: data as Data)
let myObject = unarchiver.decodeObject(forKey: theKey) as? TheObjectType // <<-- This returns nil
This builds correctly.
But on execution, unarchiver.decodeObject now returns nil.
I have searched extensively to find the cause to no avail.
I may probably change the design to avoid NSKeyedArchiver, but that would be a huge refactoring.
I probably miss something obvious.
Could someone hint at the possible cause ?
I need to encode and decode Array<Array>
SomeStruct is multiplexed in an Int
The former API did work:
if let format = decoder.decodeObject(forKey: someKey) as? Array<Array<SomeStruct>> { }
But using the new API
if let format = decoder.decodeObject(of: Array<Array<Int>>.self, forKey: someKey) {
generates an error:
Cannot convert value of type 'Array<Array<Int>>.Type' to expected argument type '[AnyClass]' (aka 'Array<any AnyObject.Type>')
encoding is done as follows:
var format = Array(repeating: Array(repeating: 0, count: 4), count: 4)
// initialize the var
coder.encode(format, forKey: someKey)
What is the correct syntax ?
I have defined a class :
class Item: NSObject, NSSecureCoding {
var name : String = ""
var color : ColorTag = .black // defined as enum ColorTag: Int
var value : Int = 0
static var supportsSecureCoding: Bool {
return true
}
Its decoder includes the following print statement to start:
required init(coder decoder: NSCoder) {
print(#function, "item should not be nil", decoder.decodeObject(of: Item.self, forKey: someKey))
Another class uses it:
class AllItems: NSObject, NSSecureCoding {
var allItems : [Item]?
static var supportsSecureCoding: Bool {
return true
}
and decodes as follows
required init(coder decoder: NSCoder) {
super.init() // Not sure it is necessary
allItems = decoder.decodeObject(of: NSArray.self, forKey: mykey) as? [Item]
print(#function, allItems) // <<-- get nil
}
I note:
decoder returns nil at line 5
I have tried to change to
decoder.decodeObject(of: [NSArray.self, NSString.self, NSColor.self, NSNumber.self], forKey: mykey))
Still get nil
And, decoder of class Item is not called (no print in the log)
What am I missing ?
I get several warnings in log:
*** -[NSKeyedUnarchiver validateAllowedClass:forKey:] allowed unarchiving
safe plist type ''NSNumber' (0x204cdbeb8)
[/System/Library/Frameworks/Foundation.framework]' for key 'NS.objects',
even though it was not explicitly included in the client allowed classes set: '{(
"'NSArray' (0x204cd5598) [/System/Library/Frameworks/CoreFoundation.framework]"
)}'. This will be disallowed in the future.
I am not sure how to understand it:
I have removed every NSNumber.self in the allowed lists for decode. To no avail, still get the avalanche of warnings.
What is the key NS.objects about ?
What may allowed classes set: '{(
"'NSArray' be referring to ? An inclusion of NSArray.self in a list for decode ? The type of a property in a class ?
I decode an object with NSKeyedArchiver (SecureCoding):
typealias BoolArray = Array<Array<Bool>>
let val = decoder.decodeObject(of: NSArray.self, forKey: someKey) as? BoolArray
I get the following log:
*** -[NSKeyedUnarchiver validateAllowedClass:forKey:] allowed unarchiving safe plist type ''NSNumber' (0x204cdbeb8) [/System/Library/Frameworks/Foundation.framework]' for key 'NS.objects', even though it was not explicitly included in the client allowed classes set: '{(
"'NSArray' (0x204cd5598) [/System/Library/Frameworks/CoreFoundation.framework]"
)}'. This will be disallowed in the future.
I changed by adding NSNumber.self in the list :
let val = decoder.decodeObject(of: [NSArray.self, NSNumber.self], forKey: someKey) as? BoolArray
No more warning in log.
Is there a reason for this ?
In a class, I call the following (edited to simplify, but it matches the real case).
If I do this:
func getData() -> someClass? {
_ = someURL.startAccessingSecurityScopedResource()
if let data = NSData(contentsOf: someURL as URL) {
do {
let unarchiver = try NSKeyedUnarchiver(forReadingFrom: data as Data)
print((unarchiver.decodeObject(of: [NSArray.self, someClass.self /* and few others*/], forKey: oneKey) as? someClass)?.aProperty)
if let result = unarchiver.decodeObject(of: [NSArray.self, someClass.self /* same other types*/], forKey: oneKey) as? someClass {
unarchiver.finishDecoding()
print("unarchived success")
return result
} else {
unarchiver.finishDecoding()
print("unarchiving failed")
return someClass()
}
}
catch {
return nil
}
}
I get a failure on log : unarchiving failed
But if I comment out the print(unarchiver.decodeObject) - line 8, it works and I get unarchived success
// print((unarchiver.decodeObject(of: [NSArray.self, someClass.self /* and few others*/], forKey: oneKey) as? someClass)?.aProperty)
However, when I do exactly the same for another class (I've compared line by line to be sure), it works even with the print statement.
What could be happening here ?
That's a question for Mac app (Cocoa).
I want to change the standard highlighting.
I thought to use tableView.selectionHighlightStyle.
But there are only 2 values: .none and .regular. Cannot find how to define a custom one.
So I tried a workaround:
set tableView.selectionHighlightStyle to .none
func tableView(_ tableView: NSTableView, viewFor tableColumn: NSTableColumn?, row: Int) -> NSView? {
tableView.selectionHighlightStyle = .none
keep track of previousSelection
Then, in tableViewSelectionDidChange
reset for previousSelection
func tableViewSelectionDidChange(_ notification: Notification) { }
if previousSelection >= 0 {
let cellView = theTableView.rowView(atRow: previousSelection, makeIfNecessary: false)
cellView?.layer?.backgroundColor = .clear
}
set for the selection to a custom color
let cellView = theTableView.rowView(atRow: row, makeIfNecessary: false)
cellView?.layer?.backgroundColor = CGColor(red: 0, green: 0, blue: 1, alpha: 0.4)
previousSelection = row
Result is disappointing :
Even though tableView.selectionHighlightStyle is set to .none, it does overlays the cellView?.layer
Is there a way to directly change the color for selection ?
Since recently, when I try to close a thread I created on an answer of mine, I get the following error:
Trying later, next day, does not solve it. In the list of all threads, the post is not marked as answered.
But if I look via Chrome or plain Safari, I see the answer itself is marked as correct:
Which is not the case when opening in Safari Technology Preview (Release 233) where the same answer is still to be accepted:
I have an NSWindowController with several IBOutlets created in storyboard.
I want to add an NSView and fill it with some color. I need to place it at a specific position in views hierarchy.
I have tried 2 ways, no one succeeds.
First.
include a custom view in storyboard
connect to an IBOutlet
in an init of controller, set the layer for the view
Result: crash
Second
build programmatically
Result: I do not find where to put this code in the controller code
That's basic Cocoa, but way more painful than iOS.
In this app I use tooltips extensively.
They work perfectly well, except in a popover where they may appear or not (just some flash and immediately disappear).
In the popover there are 12 colour buttons, each with its own tracking area and 3 control buttons, with their tracking areas.
Here when it works, hovering over "C" button or "Annuler" button:
But then, when I move to another colour button, a few 2 or 3 may work, but most don't display their tooltip at all.
I know that the tooltip is set because I replicate the message in a help line at the bottom of the screen and this line always update:
Let messageForColor = "Choisir la couleur…"
if button.isEnabled { // show tooltip
button.toolTip = messageForColor
} else {
button.toolTip = nil
}
if button.isEnabled { // Shows helpline at the bottom of screen
button.helpMessage = messageForColor
}
Maybe it comes from some useDefault (I modified NSInitialTool TipDelay and I'm not sure I have reset to the default value)
I noted that if I wait for 10 seconds or so (keeping the popover opened), everything seems to work properly again. Just as if there was some lengthy initialisation going on.
So questions:
Is there a known issue of Tooltips in a popover ?
Are there other parameters to set in userDefaults to avoid immediate disparition of the tooltip in popover ?
How to reset the factory setting for the UserDefaults in the app ?