Posts

Post not yet marked as solved
1 Replies
551 Views
I'm maintaining a very old Obj-c app using the very useful FSCopyObjectAsync and FSMoveObjectAsync APIs to make async copy with progress info (including the throughput) Now I must drop compatibility with 10.9 and I would to replace these APIs (consider they are no longer available with Swift), but Apple deprecated them without a replacement, any hints? I found the C API copyfile, it doesn't return the throughput and the fixed read buffer size (65k) is ridicolous because copy is very slow compared to FSCopyObjectAsync. I would avoid to fork copyfile... Do you know some other more Apple-like API similar to FSCopyObjectAsync?
Posted
by dafi.
Last updated
.
Post marked as solved
2 Replies
1.4k Views
We have a valid DUNS number for our organization, now a subsidiary developed an app and they want to publish it using their apple developer account (unrelated to ours) but they can't because we own the main DUNS. We must share the DUNS with them? Is it enough? Is it the correct behaviour? The subsidiary must have access to our account to publish the app? (We don't want)
Posted
by dafi.
Last updated
.
Post not yet marked as solved
1 Replies
683 Views
I need to read the tags assigned to a file, if I use the code shown below on cli tools projects everything works fine, the identical code executed from sandboxed apps returns only the first element NSDictionary<NSURLResourceKey, id>* dict = [[NSURL fileURLWithPath:@"absolute_file_path"] resourceValuesForKeys:@[NSURLTagNamesKey] error:nil]; NSLog(@"Result %@", dict); The same with swift, running the code from playground the result is correct, running it from swift sandboxed app only the first element is returned Is this a bug?
Posted
by dafi.
Last updated
.
Post not yet marked as solved
5 Replies
1.2k Views
My sandboxed app contains a command line tool (CLT) also sandboxed. The command line tool sends an Apple Event to the app but this works only if the CLT entitlements contains <key>com.apple.security.temporary-exception.apple-events</key> <array> <string>com.my-app-bundle-id</string> </array> The CLT and bundle ids are identical, the team id is identical, too I can't find where the error is hidden, may you help me? The app is distributed via the Mac App Store I show below the plist and entitlements App entitlement <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>com.apple.security.app-sandbox</key> <true/> <key>com.apple.security.application-groups</key> <array> <string>$(TeamIdentifierPrefix)com.appgroup.myapp</string> </array> <key>com.apple.security.files.bookmarks.app-scope</key> <true/> <key>com.apple.security.files.user-selected.read-write</key> <true/> <key>com.apple.security.network.client</key> <true/> </dict> </plist> App plist <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleDevelopmentRegion</key> <string>English</string> <key>CFBundleDisplayName</key> <string>myapp</string> <key>CFBundleDocumentTypes</key> <array> <dict> <key>CFBundleTypeExtensions</key> <array> <string>myext</string> </array> <key>CFBundleTypeIconFile</key> <string>my</string> <key>CFBundleTypeMIMETypes</key> <array> <string>application/octet-stream</string> </array> <key>CFBundleTypeName</key> <string>myapp</string> <key>CFBundleTypeRole</key> <string>Editor</string> <key>LSTypeIsPackage</key> <false/> <key>LSHandlerRank</key> <string>Owner</string> <key>NSDocumentClass</key> <string>VDDocument</string> <key>NSPersistentStoreTypeKey</key> <string>Binary</string> </dict> </array> <key>CFBundleExecutable</key> <string>${EXECUTABLE_NAME}</string> <key>CFBundleHelpBookFolder</key> <string>myappHelp</string> <key>CFBundleHelpBookName</key> <string>com.myapp.help</string> <key>CFBundleIconFile</key> <string>my.icns</string> <key>CFBundleIdentifier</key> <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleName</key> <string>${PRODUCT_NAME}</string> <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleShortVersionString</key> <string>1.1.0</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleVersion</key> <string>1.1.0</string> <key>LSApplicationCategoryType</key> <string>public.app-category.utilities</string> <key>LSMinimumSystemVersion</key> <string>${MACOSX_DEPLOYMENT_TARGET}</string> <key>NSHumanReadableCopyright</key> <string>2010, myapp.com</string> <key>NSMainNibFile</key> <string>MainMenu</string> <key>NSPrincipalClass</key> <string>NSApplication</string> <key>ITSAppUsesNonExemptEncryption</key> <false/> </dict> </plist> Command line tool plist <?xml version="1.0" encoding="UTF-8"?> &#9;&#9;<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> &#9;&#9;<plist version="1.0"> &#9;&#9;&#9;&#9;<dict> &#9;&#9;&#9;&#9;&#9;&#9;<key>CFBundleDevelopmentRegion</key> &#9;&#9;&#9;&#9;&#9;&#9;<string>English</string> &#9;&#9;&#9;&#9;&#9;&#9;<key>CFBundleIdentifier</key> &#9;&#9;&#9;&#9;&#9;&#9;<string>com.myapp.myclt</string> &#9;&#9;&#9;&#9;&#9;&#9;<key>CFBundleInfoDictionaryVersion</key> &#9;&#9;&#9;&#9;&#9;&#9;<string>6.0</string> &#9;&#9;&#9;&#9;&#9;&#9;<key>CFBundleName</key> &#9;&#9;&#9;&#9;&#9;&#9;<string>codesign</string> &#9;&#9;&#9;&#9;&#9;&#9;<key>CFBundleVersion</key> &#9;&#9;&#9;&#9;&#9;&#9;<string>1.2</string> &#9;&#9;&#9;&#9;&#9;&#9;<key>NSAppleEventsUsageDescription</key> &#9;&#9;&#9;&#9;&#9;&#9;<string>Please give my command line tool access to my app</string> &#9;&#9;&#9;&#9;</dict> &#9;&#9;</plist> Command line tool entitlement &#9;&#9;<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> &#9;&#9;<key>com.apple.security.app-sandbox</key> &#9;&#9;<true/> &#9;&#9;<key>com.apple.security.application-groups</key> &#9;&#9;<array> &#9;&#9;&#9;&#9;<string>$(TeamIdentifierPrefix)com.appgroup.myapp</string> &#9;&#9;</array> &#9;&#9;<key>com.apple.security.automation.apple-events</key> &#9;&#9;<true/> &#9;&#9;<key>com.apple.security.temporary-exception.apple-events</key> &#9;&#9;<array> &#9;&#9;&#9;&#9;<string>com.myapp</string> &#9;&#9;</array> </dict> </plist>
Posted
by dafi.
Last updated
.
Post not yet marked as solved
7 Replies
689 Views
My sandboxed app contains a command line tool (CLT) sandoboxed, too. App and CLT have the same Team and Bundle Identifier. The CLT sends an apple script message to the app using SBApplication:applicationWithBundleIdentifier First strange behaviour - Running app from XCode (Product -> Run) If I launch the app from XCode (for debug purpose) and the CLT from terminal window I obtain the error failed to get scripting definition from .../Library/Developer/Xcode/DerivedData/.../Build/Products/Debug/my.app; it may not be scriptable If I run the app from Finder (double click it) and the CLT from terminal window everything works fine Obviously both App and CLT launched are the same, the CLT is inside the Contents/Resources's App directory Why launching from XCode doesn't work???? Second strange behaviour - Running app from another computer The app must be distributed from Mac App Store but for test purpose I notarize and copy it to other computers. If I launch the notarized app from /Applications everything works fine If I launch the notarized app from another path (e.g. /Users/dave/My.app) the command line tool bundle identifier is nil Is this the normal behaviour?
Posted
by dafi.
Last updated
.
Post not yet marked as solved
4 Replies
708 Views
I've a fully functional command line tool (CLT) communicating with its own sandboxed App. The CLT sends messages to the App and waits until the app closes. Now I need to migrate to NSXPCConnection and I started to study the AppSandboxLoginItemXPCDemo - https://developer.apple.com/library/archive/samplecode/AppSandboxLoginItemXPCDemo/Introduction/Intro.html#//apple_ref/doc/uid/DTS40012292 The sample works fine so I added a new CLT target to the project but it can't communicate with the helper (I added plist and entitlements to sandbox it) So now I have two questions how can I configure the CLT to communicate with the helper? how the helper can communicate with the App (the helper is the client and the app is the server)?
Posted
by dafi.
Last updated
.
Post not yet marked as solved
1 Replies
425 Views
Today I discovered very old code no longer works as expected on Catalina. The following code let url = URL(fileURLWithPath: "/dir1/dir2/path_to_some_folder_or_file") NSWorkspace.shared.activateFileViewerSelecting([url]) On Catalina opens Finder but the selected item is dir2 (the parent folder) on Mojave and older versions correctly the selected item is the the last component path_to_some_folder_or_file I discovered other apps have the same problem (Trasmission torrent client) Any hints?
Posted
by dafi.
Last updated
.
Post not yet marked as solved
0 Replies
328 Views
I've uploaded a new version of my app from XCode, the upload was successful but after one day the build is not visible inside the itunesconnect preparation page.Generally I wait few hours, then I receive and email confirming the upload is complete but in this case no email and no build.I've tried to reupload the app but I receive the error asking me to change the version number, this demonstrates the loaded build is validWhat can I do?
Posted
by dafi.
Last updated
.
Post not yet marked as solved
6 Replies
966 Views
My app worked fine without any crash but after upgrading to Version 11.2.1 (11B500) many strange things happen, I tried the Version 11.3 beta (11C24b) without any success.To remove any doubts related to my apps I can reproduce the crash starting a new clean projectcreate the project for MacOS -&gt; Applanguage Objective-C and very important check Create Document-Based Applicationrun the application, the window application appearsOpen two other windows with the shortcut CMD+Nclose the app with CMD+Qthe app crashes (see the stacktrace below)I've tried with two different macs both with 10.14.6 so I think the problem is related to Xcode itselfAny hint?2019-11-26 09:05:31.852866+0100 CrashEPoi[1918:173418] Metal API Validation Enabled2019-11-26 09:05:34.169223+0100 CrashEPoi[1918:173418] *** _NSDocumentBasicAsyncOperation 0x60000024adc0 went isFinished=YES without being started by the queue it is in2019-11-26 09:05:34.169398+0100 CrashEPoi[1918:173418] *** _NSDocumentBasicAsyncOperation 0x60000024b560 went isFinished=YES without being started by the queue it is in2019-11-26 09:05:34.170040+0100 CrashEPoi[1918:173759] [General] An uncaught exception was raised2019-11-26 09:05:34.170145+0100 CrashEPoi[1918:173759] [General] *** -[__NSOperationInternal _start:]: something is trying to start the receiver simultaneously from more than one thread2019-11-26 09:05:34.170281+0100 CrashEPoi[1918:173759] [General] ( 0 CoreFoundation 0x00007fff4d515bc9 __exceptionPreprocess + 256 1 libobjc.A.dylib 0x00007fff77cb93c6 objc_exception_throw + 48 2 CoreFoundation 0x00007fff4d5159fb +[NSException raise:format:] + 193 3 Foundation 0x00007fff4f6f0b19 -[__NSOperationInternal _start:] + 265 4 Foundation 0x00007fff4f71ac77 __NSOQSchedule_f + 227 5 libdispatch.dylib 0x0000000100345e7c _dispatch_call_block_and_release + 12 6 libdispatch.dylib 0x0000000100346f1b _dispatch_client_callout + 8 7 libdispatch.dylib 0x000000010034a2be _dispatch_continuation_pop + 563 8 libdispatch.dylib 0x00000001003493b4 _dispatch_async_redirect_invoke + 769 9 libdispatch.dylib 0x0000000100359824 _dispatch_root_queue_drain + 334 10 libdispatch.dylib 0x000000010035a2da _dispatch_worker_thread2 + 125 11 libsystem_pthread.dylib 0x00000001003c00b7 _pthread_wqthread + 583 12 libsystem_pthread.dylib 0x00000001003bfe01 start_wqthread + 13)2019-11-26 09:05:34.176607+0100 CrashEPoi[1918:173759] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSOperationInternal _start:]: something is trying to start the receiver simultaneously from more than one thread'*** First throw call stack:( 0 CoreFoundation 0x00007fff4d515bc9 __exceptionPreprocess + 256 1 libobjc.A.dylib 0x00007fff77cb93c6 objc_exception_throw + 48 2 CoreFoundation 0x00007fff4d5159fb +[NSException raise:format:] + 193 3 Foundation 0x00007fff4f6f0b19 -[__NSOperationInternal _start:] + 265 4 Foundation 0x00007fff4f71ac77 __NSOQSchedule_f + 227 5 libdispatch.dylib 0x0000000100345e7c _dispatch_call_block_and_release + 12 6 libdispatch.dylib 0x0000000100346f1b _dispatch_client_callout + 8 7 libdispatch.dylib 0x000000010034a2be _dispatch_continuation_pop + 563 8 libdispatch.dylib 0x00000001003493b4 _dispatch_async_redirect_invoke + 769 9 libdispatch.dylib 0x0000000100359824 _dispatch_root_queue_drain + 334 10 libdispatch.dylib 0x000000010035a2da _dispatch_worker_thread2 + 125 11 libsystem_pthread.dylib 0x00000001003c00b7 _pthread_wqthread + 583 12 libsystem_pthread.dylib 0x00000001003bfe01 start_wqthread + 13)libc++abi.dylib: terminating with uncaught exception of type NSException(lldb)
Posted
by dafi.
Last updated
.