Post

Replies

Boosts

Views

Activity

C++ std::stable_sort crashes on iOS 12
Xcode 15 creates a binary that causes a crash on iOS 12 when I use C++ std::stable_sort. The following code works on iOS 17 but causes a crash on iOS 12. I remember that the earlier Xcode had no problem. It is no problem when I change "std::stable_sort" to "std::sort". FB13430187 // // Tests.cpp // #include <tuple> #include <vector> #include <algorithm> #include <iostream> extern "C" { void execute_tests(void) { using T = std::tuple<size_t, uint64_t *>; std::vector<T> vector = { {7, nullptr}, {4, nullptr}, {9, nullptr} }; std::stable_sort(vector.begin(), vector.end(), [](const T& a, const T& b){ return std::get<0>(a) < std::get<0>(b); }); for (const T& item : vector) { std::cout << std::get<0>(item) << std::endl; } } }
9
0
1.1k
Dec ’23
Will UserDefaults via App Group be disallowed?
According to upcoming privacy manifest document, NSUserDefaults is only allowed for a use for the app itself. It is serious for developers who makes App Extensions. https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_use_of_required_reason_api CA92.1 Declare this reason to access user defaults to read and write information that is only accessible to the app itself. This reason does not permit reading information that was written by other apps or the system, or writing information that can be accessed by other apps. Developers, please submit a request to add the permission of App Group. https://developer.apple.com/contact/request/privacy-manifest-reason/
2
1
1.5k
Oct ’23
UIDocumentPickerViewController ignores directoryURL on iOS/iPadOS 16.1
I found a glitch on my app on iOS/iPadOS 16.1. The directory to open files is not saved. I filed this on Feedback Assistant but Apple says that it is a specified behavior. Isn't it a bug? // // ViewController.m // #import "ViewController.h" #import <UniformTypeIdentifiers/UniformTypeIdentifiers.h> @interface ViewController () <UIDocumentPickerDelegate> @end @implementation ViewController { NSURL *directoryURL; } - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. } - (void)documentPicker:(UIDocumentPickerViewController *)controller didPickDocumentsAtURLs:(NSArray<NSURL *> *)urls { directoryURL = [[urls firstObject] URLByDeletingLastPathComponent]; } - (IBAction)trigger:(id)sender { UIDocumentPickerViewController *picker = [[UIDocumentPickerViewController alloc] initForOpeningContentTypes:@[UTTypeData] asCopy:NO]; picker.directoryURL = directoryURL; [self presentViewController:picker animated:YES completion:nil]; } @end To reproduce the issue. Tap the button and select a file on another directory. Tap the button again. The directory should be the selected one but is the default one.
5
1
1.6k
Oct ’22