2

I'm tryng to extend my application supporting touchbar but touch bar delegate method is never called. :

- (nullable NSTouchBarItem *)touchBar:(NSTouchBar *)touchBar makeItemForIdentifier:(NSTouchBarItemIdentifier)identifier

This is the code of my view controller

    static NSTouchBarCustomizationIdentifier SliderCustomizationIdentifier = @"com.myapp.sliderViewController";
    static NSTouchBarItemIdentifier SliderItemIdentifier = @"com.myapp.slider";

        @interface SliderViewController () <NSTouchBarDelegate>

        @end




        @implementation SliderViewController


//init touch bar is called
        - (NSTouchBar *)makeTouchBar
        {
            NSTouchBar *bar = [[NSTouchBar alloc] init];
            bar.delegate = self;

            bar.customizationIdentifier = SliderCustomizationIdentifier;

            // Set the default ordering of items.
            bar.defaultItemIdentifiers =
                @[SliderItemIdentifier, NSTouchBarItemIdentifierOtherItemsProxy];

            bar.customizationAllowedItemIdentifiers = @[SliderItemIdentifier];

            return bar;
        }
//NEVER CALLED
      - (nullable NSTouchBarItem *)touchBar:(NSTouchBar *)touchBar makeItemForIdentifier:(NSTouchBarItemIdentifier)identifier
       {

       }
@end
christian mini
  • 1,662
  • 20
  • 39
  • What kind of class is the SliderViewController? - is it actually an NSViewController? And how have you set it up in the project? Is it in the responder chain? – Sean Langley Nov 24 '16 at 02:04

0 Answers0