Browse Source

ObjC Helpers: Ensure that all methods accept mandatory "self" and "selector" arguments

v6.1.6
reuk 3 years ago
parent
commit
d26945f476
No known key found for this signature in database GPG Key ID: FCB43929F012EE5C
2 changed files with 7 additions and 7 deletions
  1. +5
    -5
      modules/juce_audio_processors/juce_audio_processors.cpp
  2. +2
    -2
      modules/juce_core/native/juce_mac_ObjCHelpers.h

+ 5
- 5
modules/juce_audio_processors/juce_audio_processors.cpp View File

@@ -160,17 +160,17 @@ private:
static BOOL isFlipped (id, SEL) { return YES; }
static BOOL isOpaque (id, SEL) { return YES; }
static void nudge (NSView* self)
static void nudge (id self)
{
if (auto* owner = getIvar<NSViewComponentWithParent*> (self, "owner"))
if (owner->wantsNudge == WantsNudge::yes)
owner->triggerAsyncUpdate();
}
static void viewDidUnhide (NSView* self, SEL) { nudge (self); }
static void didAddSubview (NSView* self, SEL, NSView*) { nudge (self); }
static void viewDidMoveToSuperview (NSView* self, SEL) { nudge (self); }
static void viewDidMoveToWindow (NSView* self, SEL) { nudge (self); }
static void viewDidUnhide (id self, SEL) { nudge (self); }
static void didAddSubview (id self, SEL, NSView*) { nudge (self); }
static void viewDidMoveToSuperview (id self, SEL) { nudge (self); }
static void viewDidMoveToWindow (id self, SEL) { nudge (self); }
};
static FlippedNSView& getViewClass()


+ 2
- 2
modules/juce_core/native/juce_mac_ObjCHelpers.h View File

@@ -384,9 +384,9 @@ struct ObjCClass
}
template <typename Result, typename... Args>
void addMethod (SEL selector, Result (*callbackFn) (Args...))
void addMethod (SEL selector, Result (*callbackFn) (id, SEL, Args...))
{
const auto s = detail::makeCompileTimeStr (@encode (Result), @encode (Args)...);
const auto s = detail::makeCompileTimeStr (@encode (Result), @encode (id), @encode (SEL), @encode (Args)...);
const auto b = class_addMethod (cls, selector, (IMP) callbackFn, s.data());
jassertquiet (b);
}


Loading…
Cancel
Save