objective-c

Cocoa Key Equivalent in Menu is not working

孤街浪徒 提交于 2021-02-10 05:51:53
问题 I have created a NSStatusItem and I have assigned two key equivalents within interface builder (Xcode 4.0). These are for the preference menu cmd-, and the quit option cmd-q. Both of these will work when the Menu is highlighted/open but will not work otherwise even if the application is the foremost. Any ideas on why this is happening or how I can change this? 回答1: The operating system passes key events that it doesn't handle to the front application, which compares them to any key

Cocoa Key Equivalent in Menu is not working

Deadly 提交于 2021-02-10 05:51:51
问题 I have created a NSStatusItem and I have assigned two key equivalents within interface builder (Xcode 4.0). These are for the preference menu cmd-, and the quit option cmd-q. Both of these will work when the Menu is highlighted/open but will not work otherwise even if the application is the foremost. Any ideas on why this is happening or how I can change this? 回答1: The operating system passes key events that it doesn't handle to the front application, which compares them to any key

CGImage Masking stopped working on iOS 12

走远了吗. 提交于 2021-02-09 15:41:20
问题 I've got a method for masking a B&W image by cutting out (i.e. making transparent) any pixels that are above or below a certain brightness. The result would be the same B&W image, but with everything above 70% or below 25% brightness (or whatever you choose) changed to transparent. It was working perfectly on iOS 11, but it broke on iOS 12. It now returns the original, solid image with no modifications every time. -(UIImage*)imageWithLumaMaskFromDark:(CGFloat)lumaFloor toLight:(CGFloat

CGImage Masking stopped working on iOS 12

独自空忆成欢 提交于 2021-02-09 15:41:04
问题 I've got a method for masking a B&W image by cutting out (i.e. making transparent) any pixels that are above or below a certain brightness. The result would be the same B&W image, but with everything above 70% or below 25% brightness (or whatever you choose) changed to transparent. It was working perfectly on iOS 11, but it broke on iOS 12. It now returns the original, solid image with no modifications every time. -(UIImage*)imageWithLumaMaskFromDark:(CGFloat)lumaFloor toLight:(CGFloat

CGImage Masking stopped working on iOS 12

只谈情不闲聊 提交于 2021-02-09 15:40:32
问题 I've got a method for masking a B&W image by cutting out (i.e. making transparent) any pixels that are above or below a certain brightness. The result would be the same B&W image, but with everything above 70% or below 25% brightness (or whatever you choose) changed to transparent. It was working perfectly on iOS 11, but it broke on iOS 12. It now returns the original, solid image with no modifications every time. -(UIImage*)imageWithLumaMaskFromDark:(CGFloat)lumaFloor toLight:(CGFloat

iOS7: UITapGestureRecognizer reuse issue

狂风中的少年 提交于 2021-02-09 11:43:12
问题 I set three buttons. Every button is tagged 1...3. My UITapGestureRecognizer works only once and only for first UIButton. Can't select other two options. Code: - (void)viewDidLoad { [super viewDidLoad]; UITapGestureRecognizer *recognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(buttonTapped:)]; recognizer.delegate = self; recognizer.cancelsTouchesInView = NO; [recognizer setNumberOfTapsRequired:1]; [_btnNegative addGestureRecognizer:recognizer]; [_btnNeutral

iOS7: UITapGestureRecognizer reuse issue

。_饼干妹妹 提交于 2021-02-09 11:42:09
问题 I set three buttons. Every button is tagged 1...3. My UITapGestureRecognizer works only once and only for first UIButton. Can't select other two options. Code: - (void)viewDidLoad { [super viewDidLoad]; UITapGestureRecognizer *recognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(buttonTapped:)]; recognizer.delegate = self; recognizer.cancelsTouchesInView = NO; [recognizer setNumberOfTapsRequired:1]; [_btnNegative addGestureRecognizer:recognizer]; [_btnNeutral

Invalid parameter value for redirect_uri

蹲街弑〆低调 提交于 2021-02-09 09:27:07
问题 When i try to authenticate my app in Google Plus via Web i get an error: Error: invalid_request Invalid parameter value for redirect_uri: Missing authority: MY_APP:/oauth2callback I did everything according to the instructions: https://developers.google.com/+/mobile/ios/getting-started However, authentication with Google Plus application runs fine. What's the problem? 回答1: I encountered the same problem because I was using an unconventional bundle id i.e it was not in the format com.company

Invalid parameter value for redirect_uri

十年热恋 提交于 2021-02-09 09:26:03
问题 When i try to authenticate my app in Google Plus via Web i get an error: Error: invalid_request Invalid parameter value for redirect_uri: Missing authority: MY_APP:/oauth2callback I did everything according to the instructions: https://developers.google.com/+/mobile/ios/getting-started However, authentication with Google Plus application runs fine. What's the problem? 回答1: I encountered the same problem because I was using an unconventional bundle id i.e it was not in the format com.company

Trying to change MKPointAnnotation colour but losing the title

徘徊边缘 提交于 2021-02-09 08:32:51
问题 I am trying to change my pin colour to purple, when I do it I lose the title though. Code is: - (void)viewDidLoad { [super viewDidLoad]; self.navigationController.navigationBarHidden=YES; //init the location manager self.locationManager = [[CLLocationManager alloc] init]; self.locationManager.desiredAccuracy = kCLLocationAccuracyBest; [self.locationManager requestWhenInUseAuthorization]; self.mapView.showsUserLocation=YES; self.userGeoPoint=self.message[@"userLocation"]; self.pinView = [