I am using the "Debug Selected Views" feature in Xcode 6 beta 5, I set a breakpoint within my prepareForInterfaceBuilder() function.
But when I try to use the po command, it gives me an error:
(lldb) po almondImage
error: Error in auto-import:
Failed to load linked library swiftQuartzCore of module TrailMixKit - errors:
Looking for "#rpath/libswiftQuartzCore.dylib", error: not a string object
Here are the first few lines of my file (including imports):
//
// TrailMixIngredientImageView.swift
// Trailmix
import UIKit
import QuartzCore
If I set a breakpoint while running the app in the simulator, the po command works without error.
Can't add comment but did you add the framework for QuartzCore?
Related
Without any reason, Xcode show an error when i whan ton print using the debuger console :
(lldb) po self
warning: Swift error in scratch context: error: failed to load module 'XXX'
.
Shared Swift state for XXX.app has developed fatal errors and is being discarded.
REPL definitions and persistent names/types will be lost.
error: expression failed to parse:
unknown error
It's an iOS project with cocoapods. I'm on an M1 pro chip.
Any idea ?
I would start with simply print(self) instruction and check what appears in the console.
I like also debug(self) function (prints the whole object hierarchy).
If you want to print thread, you can use Thread.callStackSymbols.forEach { print($0) }
Have you tried set a breakpoint and then browse the Variable List (left side of the Debug Area)?
I have a target with mixed Swift and Objective-C code. I do the following:
I put a breakpoint on a line in a Swift file part of this target.
I run this target.
I type po $someVariableName in the debugger once it hits the breakpoint.
The debugger now shows a host of errors, ending with:
error: failed to import bridging header '/path/to/Bridging-Header.h'
Couldn't initialize Swift expression evaluator due to previous errors.
The output starts with:
Error while loading Swift module:
TARGET_NAME: /path/to/Bridging-Header.h:18:9: note: in file included from /path/to/Bridging-Header.h:18:
In between are a host of nullability annotation warnings and errors about unknown type names. Some errors come from bridging headers in the Carthage builds directory:
error: /path/to/project/Carthage/Build/iOS/Some.framework/Headers/Some-Swift.h
It seems as if whatever is executing after my po statement, lacks a few header imports or executes things in the wrong order. Any clue as to what could be wrong here?
I am using Xcode 11.4 (11E146)
I have Objective-C project and I decided to write unit test in Swift.
Everything runs normally however I cannot see param values during debugging.
When I set cursor on value I see its name and not value:
when I try to print it out in lldb I get following error:
(lldb) po expectedEncryptedStr
warning: Swift error in module AppLibTests.
Debug info from this module will be unavailable in the debugger.
error: in auto-import:
failed to get module 'AppLibTests' from AST context:
I use Version 8.2.1 (8C1002)
Any ideas?
[EDIT]
When I enter with braking point to Objective-C code - everything works as expected
hi it's my first time to post.
I'm now doing a tutorial on Xcode 8.2.1 playground using SQLite from below website:
https://www.raywenderlich.com/123579/sqlite-tutorial-swift
I downloaded a Xcode source containing a playground and a SQLite project, and i uploaded it to the following path.
https://github.com/TerryDon2017/My-SQLite.swift-master-tutorial.git
I have the error message below:
Playground execution failed: error: SQLite.playground:1:8: error: no
such module 'SQLite' import SQLite
^ thread #1: tid = 0x1cd7d, 0x00000001094e9360 com.apple.dt.Xcode.PlaygroundStub-macosx`executePlayground, queue =
'com.apple.main-thread', stop reason = breakpoint 1.1
I was told to do 2 things:
1.drag the SQLite.xcodeproj to the workspace
2.set the build dependency
i think I did 1 ok but for 2 i could not find anyway to set the dependency for the playground. could you please kindly help? thanks!
I'm trying to use playground in xcode 7 to test some code but for some reason it won't run.
This is the error I'm getting
Playground execution failed: /var/folders/q6/zswv_4wj16zbckfbdtl9lmyh0000gp/T/./lldb/11352/playground14.swift:1:8: error: module file's minimum deployment target is ios9.0 v9.0: /var/folders/q6/zswv_4wj16zbckfbdtl9lmyh0000gp/T/com.apple.dt.Xcode.pg/auxiliarymodules/C2294E15-2E60-47B3-8A0B-DABB2C0C3D88/MyPlayground_Sources.framework/Modules/MyPlayground_Sources.swiftmodule/x86_64.swiftmodule
import MyPlayground_Sources
This is the very simple code I'm trying to execute.
class testClass{
var property = "some property"
}
var test = testClass()
test.property
What does it mean by module file's minimum deployment target is ios9.0?
I think I found what the problem is.
I opened an Xcode 6 playground file in Xcode 7.
When I create a new playground in Xcode 7 it works fine.