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

+[UIImage circleBrushTexture]: unrecognized selector sent to class 0x106d7aa50 using Swift? #22

Open
ghost opened this issue Apr 16, 2017 · 3 comments

Comments

@ghost
Copy link

ghost commented Apr 16, 2017

Sorry for buggin'!

I'm having trouble, perhaps it's on my part, but i get the unrecognized selector error. I'm using Swift to implement JotUI and the following function is the culprit:

  • (JotSharedBrushTexture*)brushTexture {
    JotGLContext* currContext = (JotGLContext*)[JotGLContext currentContext];
    (... yada yada yada ....)
    JotSharedBrushTexture* texture = [currContext.contextProperties objectForKey:@"brushTexture"];
    if (!texture) {
    // ######## PROBLEM ########
    NSLog(@"Creating a texture");
    texture = [[JotSharedBrushTexture alloc] initWithImage:[UIImage circleBrushTexture]];
    NSLog(@"After creating texture"); // doesn't log from here.
    // ########################
    [currContext.contextProperties setObject:texture forKey:@"brushTexture"];
    }
    return texture;
    }

Could this be because I'm just using Swift and this on my part?

@adamwulf
Copy link
Owner

[UIImage circleBrushTexture] is defined in UIImage+BrushTextures.h/m. I suspect you just need to translate those files to Swift as well, and then it'll work fine :)

Very interested to hear how the Swift port goes! Keep me updated for sure, that'll be awesome when it's done

@adamwulf
Copy link
Owner

adamwulf commented Apr 16, 2017

Oh ha! I probably misread your comment that you were translating into swift, not importing into your swift project! My only excuse is that it's very late at night and shouldn't be replying to things... :)

Another thought- look at the other linker flags in build settings and make sure they have the -ObjC -all_load. Check the included sample project- I may need to update the readme about that.

@adamwulf
Copy link
Owner

Ok - I double checked and i'd missed adding that to the readme, so just pushed an update for that - thanks for posting about the issue :). It also seems that only -ObjC is needed, not the -all_load, at least for the included sample project, so give that a try first.

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

1 participant