Posts

Post not yet marked as solved
1 Replies
1.2k Views
I am currently testing IAP of auto-renewable subscription with Sandbox account. Purchase auto-renewable subscription Purchase the subscription again during the period of validity. SKPaymentTransactionStatePurchasing arrives Popup appears "You are currently subscribed" with "Manage" and "OK" buttons. So far this is common to iOS 13 and 14. However, when tapping the "OK" button, the flow continues with a different behavior as follow: iOS 13: Purchase fails as SKPaymentTransactionStateFailed arrives with SKErrorPaymentCancelled iOS 14: Purchase succeeds as SKPaymentTransactionStatePurchased arrives This new behavior affects the code that I am writing so I need to confirm that this behavior was actually changed by design on iOS 14 and it's the expected one. I found no documentation for such change, so any reference would be greatly appreciated. It also would be interesting to know if anyone else detected this behavior and whether this behavior appears in production environment or only in test environment.
Posted
by Yoash.
Last updated
.
Post not yet marked as solved
5 Replies
3k Views
My iOS app (paid app) is currently localized to ten different languages. However, some of the languages are not justifying the required ongoing efforts to support them. I therefore wish to remove a specific language, but I wonder if there are any basic rules or limitations about removing a language from an app. For example, am I required announcing the removal in some place (e.g. App Store or my website), for a predefined time period (e.g. one year ahead of removal) I can easily envision a case where a user who just purchased the app with support for her native language, have the app suddenly appear in English on the next update from the App Store. And that after paying nicely for the app and putting the efforts to build its database. That would obviously frustrate the user. Any thoughts about how to deal with this?
Posted
by Yoash.
Last updated
.
Post not yet marked as solved
1 Replies
825 Views
Here is my use case: I need to export a large core data store into some format (e.g., CSV, JSON) which requires fetching all objects of the main entity, and then iterating each object and serializing it to the desired format. Here is my code: NSError *error = nil; NSFetchRequest *request = [NSFetchRequest fetchRequestWithEntityName:@"MyEntity"]; NSArray<NSManagedObject *> *allItems = [managedObjectContext executeFetchRequest:request error:&error]; for (NSManagedObject *item in allItems) { &#9;&#9;[self exportItem:item]; } Since the for-loop code is running synchronously and in a single thread, it might take a long time to complete. This is especially true when dealing with a large database containing thousands of records. I wonder if there is a way to iterate the array concurrently, in a way that will take full advantage of the multiple cores available on the iOS device (rather than using only a single core). This would probably boost the performance significantly. I was thinking in the direction of using the following code to replace the for-loop code above: [allItems enumerateObjectsWithOptions:NSEnumerationConcurrent usingBlock:^(NSManagedObject* item) { &#9;&#9;[self exportItem:item]; } However, this would obviously crash the app due to violating core data concurrency rules... Any ideas how to target this use case?
Posted
by Yoash.
Last updated
.
Post marked as solved
2 Replies
3.8k Views
It's hard to believe, but when using the run argument "-com.apple.CoreData.ConcurrencyDebug 1", the app would crash consistently just because its name (PRODUCT_NAME variable in Xcode build settings) starts with "Music" or "Musik". Simply changing the target name prevents the crash. This issue started appearing only on iOS 14.0 To reproduce: Use Xcode 12.01 to create a new project -> iOS -> App. Use Core Data and Objective-c in the wizard settings. Enter an app name which is starting with "Music" or "Musik". For example "MusicTest". Place "-com.apple.CoreData.ConcurrencyDebug 1" in the scheme run arguments. Add a new entity to the data model named "TestEnt" Add the following code to the end of the AppDelegate.m file. (void)test {   //   // Set run argument in the scheme as follow:   // -com.apple.CoreData.ConcurrencyDebug 1   //   NSLog(@"TEST");   dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0), ^{     NSManagedObjectContext *managedObjectContext = [self managedObjectContext];     [managedObjectContext performBlockAndWait:^{       NSError *error = nil;       NSFetchRequest *request = [NSFetchRequest fetchRequestWithEntityName:@"TestEnt"];       NSArray *result = [managedObjectContext executeFetchRequest:request error:&error];       NSLog(@"result=%@", result);     }];   }); } (NSManagedObjectContext *)managedObjectContext {       // The old-fashion way to create a managed object conttext       NSString *documentsDir = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];   NSString *storeFilePath = [[documentsDir stringByAppendingPathComponent:@"MusicTest"] stringByAppendingPathExtension:@"sqlite"];   NSURL *storeURL = [NSURL fileURLWithPath:storeFilePath];           NSURL *objectModelURL = [[NSBundle mainBundle] URLForResource:@"MusicTest"                           withExtension:@"momd"];   NSManagedObjectModel *objectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:objectModelURL];       NSPersistentStoreCoordinator *coordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:objectModel];       NSDictionary *options = @{NSMigratePersistentStoresAutomaticallyOption: @YES,                NSInferMappingModelAutomaticallyOption: @YES};   NSError *error = nil;   [coordinator addPersistentStoreWithType:NSSQLiteStoreType                configuration:nil                     URL:storeURL                   options:options                    error:&error];       NSManagedObjectContext *managedObjectContext = nil;   if (coordinator != nil) {     managedObjectContext = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSPrivateQueueConcurrencyType];     managedObjectContext.persistentStoreCoordinator = coordinator;     managedObjectContext.mergePolicy = NSMergeByPropertyObjectTrumpMergePolicy;   }       return managedObjectContext; } Modify code on ViewController.m as follow: (void)viewDidLoad {   [super viewDidLoad];       [(AppDelegate *)UIApplication.sharedApplication.delegate test]; } Run project and view crash coming. Multithreading_Violation_AllThatIsLeftToUsIsHonor Select MusicTest project on the project navigator. Rename "MusicTest" appearing under "TARGETS" on the main window to "MyMusicTest" Run project again No crash this time. Did Anyone encounter this issue? Can someone from Apple kindly reply?
Posted
by Yoash.
Last updated
.