Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot po swift local variable in my Objective-C project #143

Closed
liuxuan30 opened this issue Jun 11, 2015 · 3 comments
Closed

cannot po swift local variable in my Objective-C project #143

liuxuan30 opened this issue Jun 11, 2015 · 3 comments

Comments

@liuxuan30
Copy link
Member

I know it's not the right place to ask this question, but I have asked it on stack overflow:
http://stackoverflow.com/questions/30750296/cannot-po-swift-objects-in-objective-c-project-on-xcode-6-3-and-swift-1-2

But no answer and I googled a lot, no luck either.

I dragged the swift ios-charts code files into my Objective-C project, and they are playing well with each other.

However, when I add a breakpoint at RadarChartView - drawRect: _xAxisRenderer?.renderAxisLabels(context: context);

        let context = UIGraphicsGetCurrentContext();

        _xAxisRenderer?.renderAxisLabels(context: context);

        if (drawWeb)
        {
            renderer!.drawExtras(context: context);
        }

If I try to use po self or po context, it is keeps saying
error: Error in auto-import:
failed to get module 'CGBase' from AST context

How can I solve this? Really appreciate! Or you can answer it on stack overflow!

@liuxuan30
Copy link
Member Author

well If I change

import CoreGraphics.CGBase
import UIKit.UIColor

into

import CoreGraphics
import UIKit

The issue is gone! However, is this a LLDB bug?? I am not sure if import CoreGraphics casues any side effect compares to import CoreGraphics.CGBase

@danielgindi This issue is reproducable on ChartsDemo on my side,

just add a breakpoint at RadarChartView:drawRect,

and try po context after let context = UIGraphicsGetCurrentContext();.

I am with official latest XCode release. Do you have such issues? Also, I am not sure does it matter to change import CoreGraphics.CGBase to import CoreGraphics

@danielgindi
Copy link
Collaborator

Yes, this is an LLDB/Xcode bug. There's lot's of trouble printing variables when debugging mixed projects. But when using the inspector to dive in - you can see all of them. Weird.
We're hoping it would be fixed in the near future, when the next Xcode versions are released.

But your solution with the imports look great - I will try those!

danielgindi added a commit that referenced this issue Jun 11, 2015
@danielgindi
Copy link
Collaborator

It's committed now, you can try it :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants