This was really a quite useful thread, because security sandbox issues are difficult to manage using just Apple official documentation.
Thanks to @Crudough Crudough that pose the question (and the final correct code) and to @OOPer and @Claude31 for the guidelines.
Post
Replies
Boosts
Views
Activity
I was able to get rid of that section editing manually, with an external text editor, the file Project-Name-Info.plist that was located inside my project folder (in my case: Mac-Stager-Info.plist)
I did this with XCode not running: once done, that section was finally gone :)
@Claude31 Hi, Claude. Subject can't be @Observable, because only classes can be that and it's a struct.
From the code (to keep it short) I omitted the observable class that embeds the subjects array, because it doesn't make any difference. In the Apple sample project the piece of code I posted works perfectly... and stops to work once copied to the new project created in Xcode 16 :)
I was also guessing if there's a "new" directive in deployment target, following your idea...
It's quite a boring task, but I'll try to do that: I'm really curios, because if I don't understand I tend to became mind sick :)
@Claude31
Maybe I found the reason for this strange behavior: the problem seems to be in the Equatable implementation I made for the Subject structure.
I thought the Equatable was involved only when dealing with lists and selections: only today (unable to see updates "randomly" after editing a resource), I realize that the Equatable seems to rule also the redraw of the containing view.
Following my first interpretation, I checked for Equality only the 4 main attributes, thus any change made to the other attributes had no influence on inequality.
Now I added a lastUpdate timeStamp to the struct, always up-to-date with updates and placed it in the Equatable == function.
Even if I turn-arounded my original problem using a temporary Observable Class editSubject, I'll study deeper this behavior, making a test project where in the Equatable are compared ALL the structures attributes... just to be sure to fully understand this, that seems to be a very basic for SwuiftUI, but not so emphasized in documentation (all sample are always too simple, compared to real life needs, unfortunately).
If you are interested, I'll keep you posted.
And maybe could be useful for others :)
(Editing, 'cose I forgot to tell..)
of course, it seems to be an error of mine!