Coder Social home page Coder Social logo

Comments (15)

shpakovski avatar shpakovski commented on July 29, 2024

Hi Cris, thank you for the problem report and the clear sample project. Indeed MASShortcut is resetting the hotkey and its block while NSOutlineView is being loaded and changing preferences. I will think how to improve the component to avoid this. Till then, please consider a workaround like loading NIB in the next run loop out of the block. Sorry for inconvenience :)

from masshortcut.

synapse avatar synapse commented on July 29, 2024

Workaround:
move all your code from the block to a method and run the method from within the block like this:

[self performSelectorOnMainThread:@selector(yourMethod) withObject:nil waitUntilDone:NO]; //if UI is involved
[self performSelectorInBackground:@selector(yourMethod) withObject:someObject]; //if no UI involved

from masshortcut.

DenVog avatar DenVog commented on July 29, 2024

Thank you for posting this! I was running into this same issue, and was beating my head against the wall trying to figure out what I was doing wrong. This got it!

from masshortcut.

lmirosevic avatar lmirosevic commented on July 29, 2024

Just want to second this issue. The workaround posted by synapse does work but it would be nice to see this fixed some time.

from masshortcut.

holgersindbaek avatar holgersindbaek commented on July 29, 2024

I think I have the same problem. It is really strange.

I call a method each time the user pressed their shortcut key, which hides and shows the current window. Pressing the shortcut works once or twice, but then it doesn't work anymore.

I've pinpointed the exact line where things go wrong and it is this one:

[[NSUserDefaults standardUserDefaults] setInteger:newNumber forKey:@"timesDisplayed"];

I have absolutely no clue why this should screw up the shortcut, but it does. Now I've put that line into a method and I'm calling that method with this:

[self performSelectorInBackground:@selector(timesDisplayed) withObject:nil];

So now the shortcut works 12-17 times before it breaks. Would be great if someone could take a look at this, because that's a major downer :-(.

Awesome library besides that.

from masshortcut.

shpakovski avatar shpakovski commented on July 29, 2024

@holgersindbaek The problem is with how the MASShortcut component handles changes in user defaults, I will investigate into this as soon as I have time. Sorry for inconvenience guys.

from masshortcut.

holgersindbaek avatar holgersindbaek commented on July 29, 2024

Sounds great. Looking forward to it!

It's a great little library. Gonna use it much more in the future.

Holger Sindbaek
Holgersindbaek.com (http://Holgersindbaek.com)

Co-founder
Uninkd.com (http://Uninkd.com)
Meer.li (http://Meer.li)

On Tuesday, April 2, 2013 at 6:06 AM, Vadim Shpakovski wrote:

@holgersindbaek (https://github.com/holgersindbaek) The problem is with how the MASShortcut component handles changes in user defaults, I will investigate into this as soon as I have time. Sorry for inconvenience guys.


Reply to this email directly or view it on GitHub (#14 (comment)).

from masshortcut.

keith avatar keith commented on July 29, 2024

+1 on this issue, my user defaults change an unrelated key and after a time or two the shortcut is unregistered via this method

from masshortcut.

shpakovski avatar shpakovski commented on July 29, 2024

Guys, I made some changes suggested by @Keithbsmiley, so could you please try the latest commits? Does it help? Thanks in advance!

from masshortcut.

keith avatar keith commented on July 29, 2024

This does not seem to remove the observer from the previous shortcut after changing it

from masshortcut.

shpakovski avatar shpakovski commented on July 29, 2024

Oops, looking into this…

from masshortcut.

shpakovski avatar shpakovski commented on July 29, 2024

Done, please try again. Sorry for inconvenience!

from masshortcut.

keith avatar keith commented on July 29, 2024

This seems to fix all the issues I experienced 🍻

from masshortcut.

shpakovski avatar shpakovski commented on July 29, 2024

Wohoo, thanks all for your help!

from masshortcut.

keith avatar keith commented on July 29, 2024

Thanks for the great tool!

from masshortcut.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.