I would just save the value and update the achievement. When the new value is added update with Int(savedUnits/total * 100.0).
savedUnit += 1
let valtest = ( saveUnit / 1000 * 100.0)
GKAchievement(identifier: achievementID).percentComplete = Int(valtest)
Given that 'Int' truncates the remainder, it won't prematurely award it.
It's now mostly working. Still a few 500s. So either the issue wasn't me and resolved itself or the right person read the post a flipped a switch. I did make a change in getting the file size but I don't think that's it.
Thank you for the reply. I'm not too familiar with how this forum works despite how long I've been a member. I had tried to add a comment yesterday to explain what I found but I don't see it anywhere. So that doesn't work how I thought it did. But my problem was due to a simple misspelling when setting the metallic contents. I just had it in my brain as being similar to another issue related to trying to match colors and so I didn't see the simple answer first. The viewer was using the file being dropped directly into the spot. So no spelling issues there. And yet the programmatic equivalent was effectively being set to nil. It is all working now. Thanks.
You could just use GameCenter to manage this. User defaults is a convenient way of saving app settings in the app's sandbox. They don't remain if the user deletes the app. But if you save scores, progress, and achievements to their GameCenter account, those things stay with the account. I think there is no reason to roll your own system for this.
I can’t tell from this. For me, random crashes in ARKit seem to always trace back to improper access to the main thread. A variable getting accessed on the main that is also being changed on another thread. 99% of the time it’s fine. But occasionally it collides with itself.
It would be like any file, wouldn’t it? I’d probably setup a dedicated folder for the app’s ICloud drive and pick it up from there. Plus that interface allows the user to select it from anywhere on their drive. Look up UIDocumentPickerViewController.
I had set the preferred rendering api to openGL for compatibility with my old MacBook when in the simulation environment. Which caused the error you had in the new M1. I removed this override and the error is gone.
I would just save the value and update the achievement. When the new value is added update with Int(savedUnits/total * 100.0).
savedUnit += 1
let valtest = ( saveUnit / 1000 * 100.0)
GKAchievement(identifier: achievementID).percentComplete = Int(valtest)
Given that 'Int' truncates the remainder, it won't prematurely award it.
It's now mostly working. Still a few 500s. So either the issue wasn't me and resolved itself or the right person read the post a flipped a switch. I did make a change in getting the file size but I don't think that's it.
Thank you for the reply. I'm not too familiar with how this forum works despite how long I've been a member. I had tried to add a comment yesterday to explain what I found but I don't see it anywhere. So that doesn't work how I thought it did. But my problem was due to a simple misspelling when setting the metallic contents. I just had it in my brain as being similar to another issue related to trying to match colors and so I didn't see the simple answer first. The viewer was using the file being dropped directly into the spot. So no spelling issues there. And yet the programmatic equivalent was effectively being set to nil. It is all working now. Thanks.
You could just use GameCenter to manage this. User defaults is a convenient way of saving app settings in the app's sandbox. They don't remain if the user deletes the app. But if you save scores, progress, and achievements to their GameCenter account, those things stay with the account. I think there is no reason to roll your own system for this.
I can’t tell from this. For me, random crashes in ARKit seem to always trace back to improper access to the main thread. A variable getting accessed on the main that is also being changed on another thread. 99% of the time it’s fine. But occasionally it collides with itself.
It would be like any file, wouldn’t it? I’d probably setup a dedicated folder for the app’s ICloud drive and pick it up from there. Plus that interface allows the user to select it from anywhere on their drive. Look up UIDocumentPickerViewController.
I had set the preferred rendering api to openGL for compatibility with my old MacBook when in the simulation environment. Which caused the error you had in the new M1. I removed this override and the error is gone.