Posts

Post not yet marked as solved
5 Replies
@Claude31, Yes, it is MacOS Application Bundle. The code I'm trying is exactly the same. I'm using C++ with wxWidgets to make my application. The new laptop has OSX 10.13.6 installed with Xcode 9.4.1. The program contains of an application executable and 13 dylib projects, bundled in one Xcode workspace. Maybe when Xcode launches the binary it can't find one of the dylibs and fails to run the Bundle? But then why this doesn't happen on the old Mac. Thank you. P.S.: Is there a way to be notified about the reply posted on the thread? I didn't get any E-mails about your posting...
Post not yet marked as solved
3 Replies
Hi, Ken,I tried to rewrite an old Carbon code which checked if there is an executable with the .app extension and if not just grabbed the pid of that process. But in case it was an .app executabe (i.e. app bunde) it didn't get the pid.So I wrote the code above - which apparently broke the case with "ls", because it just wrongly presumed that it will work in any case.So I can try to add the follwing code:[code]NSURL *url = [NSURL fileURLWithPath:myPath isDirectory:YES];NSBundle *bundle = [NSBundle bundleWithURL:url];if( bundle == nil ){ printf( "Not a bundle!!"; return -1;}[/code] before the one above, but I was told that launchApplicationAtURL perform a sanity check.So, is there a "one-solution-fits-all"?Thank you.
Post not yet marked as solved
2 Replies
Hi, Ken,Yes, that is correct.However launchApplicationAtURL looks deprecated since 10.15:.https://developer.apple.com/documentation/appkit/nsworkspace/1534810-launchapplicationaturlAnd openURL signature indicates that it returns void and its available since 10.15 (presumably as a replacement for the former).https://developer.apple.com/documentation/appkit/nsworkspace/3172701-openurl?language=objcSo while I can try the former, I need something to use for the next OSX release.Thank you.
Post not yet marked as solved
2 Replies
Claude31,I just tried it.I have ~/temp directory.So I did:ln -s /Users/igor/temp /Users/igor/mylinkThen I added a file to the mylink directory.Then I ran my program with:[panel setResolveAliases:NO];But I still got /Users/igor/temp/testfile. I didn't receive "/Users/igor/mylink/testfile".In fact the Open Panel here displays temp at the top for the currect directory,I'm currently on OSX 10.13.I don't know if this use-case even suppose to work...TIA!
Post not yet marked as solved
3 Replies
Claude31,I have Xcode 9 and in there when I select "File->Duplicate... the panel slides from the top.But "File->Open does come from the middle of the screen.Sorry about the confusion.