Thanks. Have transferred it as you recommended. Please erase here. Again, thanks.
Post
Replies
Boosts
Views
Activity
Will someone please reveal if there is a soon-to-be-released update to Xcode and its associated Simulator.
This problem suddenly appeared with the Xcode 16.2 update.
PLEASE
Does anybody know if there is a soon-to-be-released update for the Xcode Simulator. If so, please inform us so I can stop worrying about this.
The fact that the problem exists only for Simulator Devices 18.x and not for 17.x seems to indicate that the answer is "yes" - but you guys are the experts on this.
FWIW, I did do a Clean build .. with same result.
TO: the above Frameworks Engineer ..
Simulator 18.x fails.
We're talking Apple TV, so there is no Mac Catalyst.
FWIW, the iPad Simulator 18.x works just dandy.
Another anomaly .. when I choose within Xcode "Window Devices and Simulators" and my Apple TV 18.2 turned on my real TV, the Devices selection is empty?
I accessed an old App of mine that used my Game Controller and The real app worked great .. the Simulator version still failed for Apple TV, version 18.x.
Apple TV, version 17.5 and below worked just dandy.
Guess I'll just have to wait on Apple to make corrections.
Can someone tell me if the upcoming Sequoia 15.3 and associated Xcode/Simulator updates will address this sudden issue?
=====
Note
I accessed an old App of mine that used my Game Controller and it worked great.
I am forced to conclude that the newer Xcode 16.2, with Simulator 16.0, is the legitimate culprit.
=====
===== SOLVED SOLVED =====
I placed print("pause index =", savedTrainIndex)after pausing the game and got 160, e.g. I also placed print("resume index =", savedTrainIndex) before resuming and got 160 as it should be as the node was moving along the top half of the oval.
Then, as the node was moving along the bottom half of the oval, I got 90.
Here is the response I received from Apple Deve;loper Tech Support - which worked flawlessly:
When you run the follow action on a node, SpriteKit will set the position of the node to the starting position of the provided path.
The issue you are observing (when the train makes large jumps in position) is caused because of large differences in the node’s current position compared to the follow path’s starting position.
This large difference is due to a bug in your code, specifically in the closestPointInPath function, which appears to be an algorithm that tries to determine the point on the path that is closest to the current position of the node, which you then use to calculate the starting point for the new follow path.
If you replace that function with this one (which contains a naive implementation to find the closest point to the target point), you will see that the large position jumps no longer occur:
public func closestPointInPath(_ path:UIBezierPath,
toPoint:CGPoint) -> CGPoint? {
let targetPoint = toPoint
let thePoints = getPointsForPath(path)
var closestPoint = CGPoint.zero
var minDistance = CGFloat.infinity
for point in thePoints {
let distance = distanceBetween(point, targetPoint)
if distance < minDistance {
minDistance = distance
closestPoint = point
}
}
return closestPoint
}
Mr. Chistie from Apple DTS is out-of-sight awesome.
Once again, I labor for 3 weeks and DTS solves the problem in 3 days.
===== new discovery =====
I placed print("pause index =", savedTrainIndex)after pausing the game and got 160, e.g. I also placed print("resume index =", savedTrainIndex) before resuming and got 160 as it should be as the node was moving along the top half of the oval.
Then, as the node was moving along the bottom half of the oval, I got 90.
I think this is the key to my challenge because I believe after stopping and then restarting along the bottom half of the oval, the stop/restart index should be a number > 160, not 90. In short, shouldn't the index monotonically increase as it is traveling along the whole oval?
Anyway, I am currently investigating this discrepancy. Don't know if it will lead to a solution or not at this time.
SUCCESS!!
Somehow my pdf disappeared from my Copy Bundle Resources. Clicked + to add it back in. Lordy, I cannot possibly thank all of you enough for your extraordinary patience.
I'm getting there ...
Again, I call addPDFView() + displayPDF("ABOUT_OLD_WEST_LOCOMOTIVE.pdf"
within my specific SKScene's sceneDidLoad() because I have multiple SKScenes.
and an empty PDFView shows ... which tells me my Project is not seeing my .pdf file.
I do not understand this because when I select my Target's Build Phases and expand Copy Bundle Resources, the above .pdf file is listed.
???
Please note that the only reason I do not place all the PDFView code in my GameViewController is because I have 3 SKScenes, only one of which uses a PDFDocument. As a result, I add the PDFView to all SKScenes within my GameViewController and then fill it in the one SKScene that will show the PDFDocument.
As long as I am asking for help, how do I successfully place my pdfView on top Being a UIView, it has no .zPosition?
Starting over with the suggestions offered so far,
I have this in AppDelegate:
var pdfView: PDFView!
In my GameViewController’s viewDidLoad(), I call:
`addPDFView()’
which looks like this:
func addPDFView() {
pdfView = PDFView(frame: self.view.frame)
pdfView.displayMode = .singlePageContinuous
pdfView.autoScales = true
pdfView.displayDirection = .vertical
view.addSubview(pdfView)
} // addPDFView
Then, in my SKScene’s sceneDidLoad(), I call:
displayPDF("ABOUT_OLD_WEST_LOCOMOTIVE")
which looks like this:
func displayPDF(_ itsName:String) {
guard (thisSceneName == "AboutIOSScene") else { return }
let pdfView = PDFView() // see GameViewController's addPDFView()
guard let path = Bundle.main.path(forResource: itsName, ofType: "pdf")
else { return }
print("path =", path)
guard let pdfDocument = PDFDocument(url: URL(fileURLWithPath: path))
else { return }
print("pdfDocument =", pdfDocument)
pdfView.document = pdfDocument
} // displayPDF
Once again, the 2 print statements are shown .. but no pdfView.document
John
Okay, I'm back.
I am still enjoying learning about re-parenting.
In the meantime ... instead of adding the particle emitter as a child of myTrain, I place the particle emitter as a child of GameScene, which obviously isn't moving/
SOLVED
Now, back to re-parenting ...
Yes, I have a published App, but I've only been at this for 9 months. Bunches to still learn about, including re-parenting.
Will return to you, guaranteed, after I drink from the re-parenting firehose.
John