enumerateBodiesAlongRayStart prints "Chance" to console in Xcode 6 - ios

I'm using enumerateBodiesAlongRayStart and this method constantly prints the word "Chance" to my console. Is there any way to suppress this? Whats the deal?
self.gameScene.physicsWorld.enumerateBodiesAlongRayStart(self.rayStart, end: self.rayEnd, usingBlock: {
body, point, normal, stop in
})

I have the same "problem". It seems to be a debug output in /Applications/Xcode6-Beta6.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/PhysicsKit.framework/PhysicsKit. Hopefully it will be removed in beta7.
Edit by gfrs: Not removed. Currently exists in Xcode 6 GM.
Edit 2 by gfrs: Still not fixed. Currently exists in Xcode 6.1

Related

iOS app crashes with Symbol Not Found HKVerifiableClinicalRecordQuery in xcode 13.3

I have an app that runs fine on iPhone iOS 15 but crashes on simulator iOS 13. The
call to HKVerifiableClinicalRecordQuery is wrapped in a #available block but the library tries to be uploaded at launch time:
Referenced from: /Users/johndoe/Library/Developer/Xcode/DerivedData/appHere-ebozeeuyrbpizofrvpxydtfbydkf/Build/Products/Debug-iphonesimulator/MyFramework.framework/MyFramework
Expected in: /System/Library/Frameworks/HealthKit.framework/HealthKit
in /Users/johndoe/Library/Developer/Xcode/DerivedData/appHere-ebozeeuyrbpizofrvpxydtfbydkf/Build/Products/Debug-iphonesimulator/MyFramework.framework/MyFramework
This is very similar but kind of old now: https://developer.apple.com/forums/thread/12110
All entitlements seem right as the same app without changes work fine in xcode 13.1 + iOS 13.
Apple release notes don't show anything special with HK so I wonder what could this be.
The snippet of code where the call is done is this:
func requestVerifiableHealthRecords() {
if #available(iOS 15, *) {
let healthStore = HKHealthStore()
let credentialTypes = ["https://smarthealth.cards#immunization"]
let dateInterval = DateInterval(start: .distantPast, end: .now)
let predicate = HKQuery.predicateForVerifiableClinicalRecords(withRelevantDateWithin: dateInterval)
let query = HKVerifiableClinicalRecordQuery(recordTypes: credentialTypes, predicate: predicate) {
// some code here
}
healthStore.execute(query)
}
}
But as I mentioned above, crash happens at launch time, this piece of code is never even close to being executed. The simulator shows the splash screen and nothing more. Debug navigator shows start then __abort_with_payload.
The concerning line is this one:
Expected in: /System/Library/Frameworks/HealthKit.framework/HealthKit
Why is even looking for a framework in MacOS, in any case, it should be looking it in xCode bundle and it shouldn't fail/crash.
I think the error is misleading, it must be something else but I still can't figure it out.
Found the issue for this one. Hopefully can help anyone with similar crash.
Select your crashing target
Select Build Phases tab
Expand Link Binary With Libraries and change Embed setting to be Optional for the offending framework. In this case HealthKit framework
Build again and crash should've been gone now.

Use of unresolved identifier false warning Swift 3 xcode

So I edited my post to be more clear. I am new in xcode and Swift 3 and I am facing to a strange problem. My project contains several swift files. I put all my simple common methods to Utils.swift, for instance simple string functions, etc. For many days I had no problems but after a point xcode is all the time complaining with red exclamation marks in all the files where I use my method if I am calling my methods from Utils.swift file: "Use of unresolved identifier 'xxx'".
// debug is a bool variable declared before
Utils.swift:
func log(_ message: String) {
if debug {
print(message)
}
}
ViewController.swift:
log("Error happened")
This gives an error "Use of unresolved identifier 'Log' ". Obviously the function is there so I don't understand why I get this red warning with exclamation mark during coding however when I click on Build, it is successful, and it runs perfectly and the warning is gone. As soon as I start typing again in the code area, the red error comes back. If I build it once more it is successful again. It doesn't make any sense to me.
I thought it is maybe a cache problem, xcode live issues function doesn't recognise my Utils.swift or something like this... so I cleaned the build folder (cmd + shift + option + K), I cleaned the project (Product > Clean), restarted xcode, restarted Mac, removed Utils.swift, re-added Utils.swift to the project but can not get rid of these false warnings during coding but if build the project it is OK. I don't have this problem in my other projects. Any idea?
Okay I found the answer myself. Clicking on the swift file (now Utils.swift) I had to select "Location Relative to Group" in file inspector and set the appropriate target memberships as well.
It is weird that despite the previous 'wrong' settings the build completes with success however it gives an error in the code area.

How to show/hide comments in XCode 8.2.1

While programming in XCode 8.2.1, I am simply trying to perform the following action:
... but when I try to do this (either by using the mouse/menu, or using the shortcut: "Control-Shift-Command-Left Arrow") , I get the unexpected result of the "Funk" alert sound... and no folding/unfolding takes place.
I have researched the question but all other posts are outdated.
Is this a known bug or am I just doing something wrong?
Thankyou!!!!

Strange errors after converting SceneKit sample code to Swift 3

I downloaded Apple's SceneKit sample code (fox.swift) and opened it up on Xcode 8 beta 6.
It asked me to convert the code to Swift 3, which I did.
When I try to run the code on my phone I receive the errors:
Value of type ‘SCNNode’ has no member ‘run’
Value of type ‘SCNNode’ has no member ‘add’
Sample lines where the error occurs:
cameraYHandle.run(actionY)
self.cameraYHandle.add(cameraYAnimation, forKey: nil)
This leads me to three questions:
1) Are the functions 'run' and 'add' gone on SCNNode for Swift 3?
2) If so, what should I replace them with?
3) If so, if so, why didn't Xcode's converter handled them already?
Thank you for your time :)
PS.: It runned well for Mac using Xcode 7.3.
As dan commented, these translations resulted in a code without errors:
run => runAction
add => addAnimation
play => playAudio
so,
cameraYHandle.run(actionY) becomes cameraYHandle.runAction(actionY)
and so on.
Thank you, Dan.

Swift println() not showing autocomplete options while writing code

When I am trying to print using println() function it is not showing autocomplete parameter list in swift. Is there any problem in my Xcode?
Delete user/Library/Developer/Xcode/DerivedData and delete the data of folder(Derive data) and restart Xcode. Should work. If doesn't, restart mac after doing this.
Note: for Xcode 11.7 and maybe later, use the ~/Library/Developer/Xcode/DerivedData/ path.
Hi I found the reason for this....
As Dhruv mentioned, it only accepts string argument. So we need to convert object to string inline println() function.
For example:
we have integer defined as
var age:Int = 24
then we can print this as
println("\(age)")
In this case we will get autocomplete option.
On other hand println(age) will print same result as above.
Press cmd + K in your Xcode;
Do context-click on Xcode -> Quit, and the same for Simulator.
Open the project again;
If still doesn't work, you don't need to restart your mac. Write "Int." or some other system type, but not yours that you have issue with and voila!

Resources