I run my app on a brand new account on my Mac. The app crashes. The crashreport doesn't show up. In the console I find:File creation failed AppName_Timestamp.crash - uid: 502 gid: 20, euid: 502 egid: 20 - error 13: Permission deniedandFailed to save crash report for AppName[22842] to AppName_Timestamp.crash.I couldn't find any information (maybe the wrong keywords) on the internet about this issue. The app is signed with Developer ID and notarized by Apple. Why does it deny permission to save a crash report in its own container?
Post
Replies
Boosts
Views
Activity
When I enter my city and country in the Location field in 'Edit my profile', the field empty itself.
Is there a special format needed?
Is it allowed to use SF Symbols outside the app?
For example on the marketing webpage or in videos to indicate features from the app.
#FB7781864
"Apple Maps editors have worked with trusted brands and partners to offer Guides for great places around the world to eat, shop, and explore. >>> Guides in Maps will be available for cities including San Francisco, New York, London, and Los Angeles."
How can you sign up as a trusted partner for Apple Maps Guides?
And could that also be for other cities... or only those mentioned?
I have a list with items that contain a title and a date. User can set what to sort on (title or date).
However I can't figure out how to change the NSSortDescriptor dynamically.
import SwiftUI
import CoreData
struct ContentView: View {
@Environment(\.managedObjectContext) private var viewContext
@FetchRequest(sortDescriptors: [NSSortDescriptor(keyPath: \Test.title, ascending: true)], animation: .default) private var items: FetchedResults<Test>
@State private var sortType: Int = 0
@State private var sortDescriptor: NSSortDescriptor = NSSortDescriptor(keyPath: \Test.title, ascending: true)
var body: some View {
Picker(selection: $sortType, label: Text("Sort")) {
Text("Title").tag(0)
Text("Date").tag(1)
}
.pickerStyle(SegmentedPickerStyle())
.onChange(of: sortType) { value in
sortType = value
if sortType == 0 {
sortDescriptor = NSSortDescriptor(keyPath: \Test.title, ascending: true)
} else {
sortDescriptor = NSSortDescriptor(keyPath: \Test.date, ascending: true)
}
}
List {
ForEach(items) { item in
let dateString = itemFormatter.string(from: item.date!)
HStack {
Text(item.title!)
Spacer()
Text(dateString)
}
}
}
.onAppear(perform: {
if items.isEmpty {
let newEntry1 = Test(context: self.viewContext)
newEntry1.title = "Apple"
newEntry1.date = Date(timeIntervalSince1970: 197200800)
let newEntry2 = Test(context: self.viewContext)
newEntry2.title = "Microsoft"
newEntry2.date = Date(timeIntervalSince1970: 168429600)
let newEntry3 = Test(context: self.viewContext)
newEntry3.title = "Google"
newEntry3.date = Date(timeIntervalSince1970: 904903200)
let newEntry4 = Test(context: self.viewContext)
newEntry4.title = "Amazon"
newEntry4.date = Date(timeIntervalSince1970: 773402400)
if self.viewContext.hasChanges {
try? self.viewContext.save()
}
}
})
}
}
private let itemFormatter: DateFormatter = {
let formatter = DateFormatter()
formatter.dateStyle = .short
formatter.timeStyle = .none
return formatter
}()
When I change
@FetchRequest(sortDescriptors: [NSSortDescriptor(keyPath: \Test.title, ascending: true)], animation: .default) private var items: FetchedResults<Test>
to
@FetchRequest(sortDescriptors: [sortDescriptor], animation: .default) private var items: FetchedResults<Test>
the error "Cannot use instance member 'sortDescriptor' within property initializer; property initializers run before 'self' is available" appears.
I also tried to store the NSSortDescriptor in a UserDefault and create an init that creates it's own FetchRequest.. still no dynamic sorting...
Anyone a pointer where to look to solve this problem?
Whole project found here: https://github.com/l1ghthouse/FRDSD
.contextMenu {} is not working for me in my tvOS app.
It is supported in tvOS 14
https://developer.apple.com/documentation/swiftui/view/contextmenu(menuitems:)
Someone an idea how to get it working?
Example
import SwiftUI
struct NumberItem: Identifiable, Hashable {
var id = UUID()
var number: String
}
struct ContentView: View {
let array: [NumberItem] = [NumberItem(number: "423"),
NumberItem(number: "645"),
NumberItem(number: "213"),
NumberItem(number: "975"),
NumberItem(number: "357"),
NumberItem(number: "950"),
NumberItem(number: "043"),
NumberItem(number: "174")]
let columns = [GridItem(.adaptive(minimum: 300.0, maximum: 800.0))]
var body: some View {
ScrollView {
LazyVGrid(columns: columns, spacing: 20) {
ForEach(array, id: \.id) { item in
ItemView(item: item)
.contentShape(RoundedRectangle(cornerRadius: 12, style: .continuous))
.contextMenu {
// Edit
Button(action: {
print("Edit")
}) {
Text("Edit")
Image(systemName: "square.and.pencil")
}
// Delete
Button(action: {
print("Delete")
}) {
Text("Delete")
Image(systemName: "trash")
}
}
}
}
}
}
}
struct ItemView: View {
@State private var focused: Bool = false
@State var item: NumberItem
var body: some View {
Group {
Text("Item \(item.number)")
.padding()
}
.padding()
.background(Color.pink)
.cornerRadius(12)
.scaleEffect(self.focused ? 1.20 : 1.00)
.shadow(radius: 10)
.focusable(true) { isFocused in
withAnimation(.easeInOut(duration:0.3)) {
self.focused = isFocused
}
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
Full project: https://github.com/l1ghthouse/TVContextMenu
I have a Swift Package with shared code.
With Xcode's SPM added to my Xcode project.
Works great in the main app.
Doesn't work in the helper app when exported. Running the helper app in Xcode itself works fine. But when running as an exported and signed app it doesn't work.
This error message was found in console:
Fatal error: unable to find bundle named MySwiftPackageName: file MySwiftPackageName/resource_bundle_accessor.swift, line 27
I double checked, the package is really added at
Build Phase - Link Binary With Libraries
When I inspect the exported main app and helper app I found the package in the main resources folder but not in the helper app resources folder.
How can I fix this?
I have an array of activities that need to be run at a specific time. The run in a background helper app. The array is sorted on date/time.
At 12:08:51 I add a new item in the array.. to run at 12:12. Upon creation the array is sorted again and the closest is added as an activity to a NSBackgroundActivityScheduler.
However it runs at creation and a few times more before 12:12. The next automation Normal doesn't run at creation as activity (activity Normal is already in the array of activities).
Why is this happening? And how can I fix it?
Log: 12:12:15.664819+0200 Next Automation Normal on 2021-04-15 08:50:00 +0000
Code: }
I have trouble with reading a file from an App Group with my System Network Extension.
The app group container is found successfully.
However the file read returns empty.
In the app itself the same code runs fine and returns a string array of items found in the file.
Code:
func readFile() - [String] {
var jsonResult: [String] = []
guard let containerURL = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: AppConstants.groupID) else {
fatalError()
}
let fileURL = containerURL.appendingPathComponent("file.json")
if let data = try? NSData(contentsOfFile: fileURL.path, options: .mappedIfSafe) as Data {
if let json = try? JSONSerialization.jsonObject(with: data, options: .fragmentsAllowed) {
jsonResult = json as! [String]
}
}
os_log("jsonResult: %{public}@", jsonResult)
return jsonResult
}
Log:
default 09:42:19.486793+0200 app-network-extension container_create_or_lookup_app_group_path_by_app_group_
identifier: success
default 09:42:20.105792+0200 app-network-extension
jsonResult: ( )
Edit, after more digging:
fileURL is different!
App: file:///Users/me/Library/Group%20Containers/
SysExt: file:///private/var/root/Library/Group%20Containers/
Does a System Network Extension increase App Review's In Review time?
Mine is stuck "In Review" for 24 hours now.
If yes what is the average In Review time when you have a System Network Extension included in your app?
Signing code on macOS 12 with Xcode 12.5 doesn’t work properly for my iOS app.. a few seconds earlier the macOS App was signed properly.
Xcode 13 also signs it properly.
Feedback filed: FB9134464
(booting back to Big Sur solves it for now...)
Can you get a list of all the focus types?
And subscribe to notification when the users or system on behalve of the user changes to a different Focus type?
Would like to change something in my app to adapt to which Focus type the user is on.
Can I use Screen Time's Managed Settings to block access to certain apps on just my device, without the parent control part because the user creates a setup for themselves and for their own device?
Should we start using Declarative Net Request to block content and move away from the original content blockers?
When the JSON file with all the rules is changed from the container app do you need to reload the content blocker like you need to do in Safari? If yes, how do you reload?
And can you get the content blocker activation status?