NSApp searchString:inUserInterfaceItemString:searchRange:foundRange: fails if foundRange is NULL
| Originator: | peter | ||
| Number: | rdar://32868802 | Date Originated: | June 20 2017 |
| Status: | Open | Resolved: | |
| Product: | OS X | Product Version: | 10.12.5 |
| Classification: | UI/Usability | Reproducible: | Always |
Summary: If foundRange is NULL, the function appears to return NO regardless of the search result. Steps to Reproduce: NSAapplication - (BOOL)searchString:(NSString *)searchString inUserInterfaceItemString:(NSString *)stringToSearch searchRange:(NSRange)searchRange foundRange:(nullable NSRange *)foundRange NS_AVAILABLE_MAC(10_6); returns NO for all searches if foundRange is NULL. NSRange rng; NSLog( @"result is %d", [NSApp searchString:@"hello" inUserInterfaceItemString:@"hello" searchRange:NSMakeRange(0,@"hello".length) foundRange:NULL] ); NSLog( @"result is %d", [NSApp searchString:@"hello" inUserInterfaceItemString:@"hello" searchRange:NSMakeRange(0,@"hello".length) foundRange:&rng] ); Expected Results: result is 1 result is 1 Observed Results: result is 0 result is 1
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!