Comments (5)
Yes, we use the symbol later on line 147 and since it’s not defined on older systems, that code would crash there, so we need to do an availability check.
I wonder why I am not getting that warning… I guess that’s again CocoaPods: since they pull the naked files into a different framework, the build settings may be different. The code is correct, so I guess we might simply disable the warning for the particular piece of code. I’m just not happy to introduce changes that are only needed because CocoaPods can’t simply take the framework as defined by our project, sigh.
Can you try this pragma please?
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wtautological-compare"
// Give VoiceOver users feedback on the result. Requires at least 10.9 to run.
if (_recording == NO && (&NSAccessibilityPriorityKey != NULL)) {
NSString* msg = _shortcutValue ?
MASLocalizedString(@"Shortcut set", @"VoiceOver: Shortcut set") :
MASLocalizedString(@"Shortcut cleared", @"VoiceOver: Shortcut cleared");
NSDictionary *announcementInfo = @{
NSAccessibilityAnnouncementKey : msg,
NSAccessibilityPriorityKey : @(NSAccessibilityPriorityHigh),
};
NSAccessibilityPostNotificationWithUserInfo(self, NSAccessibilityAnnouncementRequestedNotification, announcementInfo);
}
#pragma clang diagnostic pop
from masshortcut.
FYI, a1eeb57 is the crash fix with some detailed info.
from masshortcut.
Thanks for the rapid answer!
I guess it is not strictly a CocoaPods thing. If I manually import your sources into my project and have -Wall
enabled I'll probably get it too. The above pragma takes care of the warning. This is a bit of a more precise "cut" though:
- if (_recording == NO && (&NSAccessibilityPriorityKey != NULL)) {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wtautological-compare"
+ BOOL accessibilityAvailable = (&NSAccessibilityPriorityKey != NULL);
+#pragma clang diagnostic pop
+ if (_recording == NO && accessibilityAvailable) {
from masshortcut.
I consider the build process to be a private implementation detail of the framework that should be encapsulated from the consumer. That’s why I’m not very happy about anyone pulling the naked source files and compiling them by hand. The downsides should be obvious in the light of the two last issues: there’s simply too much to be broken. And that’s why I like Carthage better than CocoaPods, although I use both – and greatly admire the polish and the work that went into the CocoaPods infrastructure. Philosophical excursions aside :–), I’ll try to fix this as soon as possible, hopefully by tomorrow.
from masshortcut.
I consider the build process to be a private implementation detail of the framework that should be encapsulated from the consumer. That’s why I’m not very happy about anyone pulling the naked source files and compiling them by hand. The downsides should be obvious in the light of the two last issues: there’s simply too much to be broken. And that’s why I like Carthage better than CocoaPods, although I use both – and greatly admire the polish and the work that went into the CocoaPods infrastructure.
That is a valid viewpoint, and also how most frameworks are shipped :) There is actually something nice about enforcing the same build warnings etc through all the source, but it is not exactly something I feel strongly about
Philosophical excursions aside :–), I’ll try to fix this as soon as possible, hopefully by tomorrow.
😄
from masshortcut.
Related Issues (20)
- Bridging header file instructions link broken HOT 2
- Can I add a Package.swift file and use it with SPM? HOT 7
- Unconsistency between italian translation from Apple HOT 3
- Tab isn't allowed
- Is there a way I can detect Key press and hold with MASShortcut? HOT 4
- Layout issue on macOS Big Sur HOT 3
- Can't set two arrow keys as part of a shotcut HOT 2
- Not visible to VoiceOver HOT 4
- Multiple Warnings for Deprecations HOT 6
- Toggling shortcut handling? e.g. an off-mode HOT 6
- NSKeyedUnarchiveFromData deprecated warning HOT 5
- Cannot record shortcut with format ⌥+⇧+<Letter> HOT 1
- How to binding custom shortcut on MASShortcutView ?
- Getting 'Error: missing module map file' when trying to build HOT 10
- Request: Could you push a release now that you have SMP support HOT 5
- Crash -[MASShortcutView propagateValue:forBinding:]
- Double-quoted include "MASxyz.h" in framework header, expected angle-bracketed instead HOT 2
- TIS API is deprecated
- EXC_BAD_ACCESS on Monterey when using swift String for defaultsKey
- README.md: "A nice, documented API" links to deprecated cocoadocs.org HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from masshortcut.