Sandboxed Mac OS App, saving files in a shared location? - xcode

Have a Sandboxed Mac App. It downloads files to a location, and I want other files to be able to edit and overwrite the files.
Currently, I'm saving to the Documents Container via my App:
let path = manager.URLsForDirectory(NSSearchPathDirectory.DocumentDirectory, inDomains: NSSearchPathDomainMask.UserDomainMask).first!
I then am modifying via Preview and saving the file.
In OSX 10.11 El Capitan, this is fine. However, on Mac OS 10.12 Sierra Beta when the User attempts to save, we get the warning: "The original document can't be changed, so a duplicate with your changes has been created."
The same problem occurs when saving to Application Support.
Of course, this does make sense in that many use cases for Sandboxed Apps is that they won't want other Apps touching their content. Though is there a shared space in which Sandboxed Apps can allow other Apps modify their contents?

Related

Adobe Air SOL Location for OSX

So I currently have an air app I am working on that I plan on distributing out. One of the features I have is the ability to import other SWF's and record what happens on screen. Now on windows, users are able to take the cookies of the swf that's being imported and place them in a folder so my air app can load them. This folder for windows is:
C:\Users[username]\AppData\Roaming
And inside the roaming folder will be a folder with the app name, and inside is where you would place the cookie files.
However, some of my users are reporting on the OSX end that they can not find this folder anywhere. I just got off a two hour skype call with a friend of mine who uses OSX and we could not find this folder equivalent at all. We went through three pages worth of google results and can not find this. Any help is welcome, thank you very much.
A quick google gave me the next result:
Macintosh HD:Users::Library:Preferences: AIR-App-Reverse-Domain-Name:Local Store:#SharedObjects: flashname.swf\filename.so
NOTE: On Mac OS X 10.7 (Lion) and above (Mountain Lion etc) the
Library folder is hidden...
http://www.adrianparr.com/?p=19
It looks like SharedObject files of an AIR application are located inside of the app-storage folder. And, maybe, it would be esier for you to get the path through the special variable:
File.applicationStorageDirectory + path-to-the-shared-object-directory

NSWorkspace openURL not opening files stored in iCloud Drive with default app for file type

In my app I use the following code to tell Mac OS X to open a file at a specified URL:
[[NSWorkspace sharedWorkspace] openURL:fileURL];
Where fileURL is a URL to a file stored in my app's iCloud Drive container folder.
In El Capitan, it seems that when a file is placed inside an app's iCloud Drive container, the owner of that file changes to the app who owns that iCloud Drive container.
In my situation, it means that my own app is being asked to open up any file type for files that are stored in my app's iCloud Drive container. If you take the same file and move it to your desktop, the original default app correctly launches.
Has anyone else seen this new behaviour of El Capitan?
I have filed a radar for it: rdar://22213595
Hopefully someone has found a workaround for this. It presents a problem for any app which uses NSWorkspace's openURL command if the file is stored in iCloud Drive. Just because I link to a file from my app, doesn't mean that my app should be responsible for opening it. iTunes should open music files, Preview should open PDFs and Excel should open .xlsx files for example, unless the user has specified otherwise of course.
It shouldn't matter where on someone's drive the file resides to determine which app to use to open it with.
This is the current status from Apple:
"Our iCloud team mentioned that it was an intentional change in El Capitan, but I am still checking with them the logics on the back and if there is anyway to change that behaivor. I’d update to you once getting their response."

Xcode exported mac app showing error "powerpc applications are no longer supported"

I've made simple Mac app in Xcode 5, Archived and Exported it as application without signing.
App runs properly on my Mac that it was build on but don't on any other. When I try to open it on different Mac error message "powerpc applications are no longer supported" appears.
Before send it to another Mac, put it in a zip folder to protect the exported file when downloading.

Downloading app data from a released app using Xcode 4.6

Related to How to download app data in Xcode 4.2, I am using XCode 4.6 and can no longer download my app data using the Xcode Organizer. My app was recently released to the app store, and I can't recall, but I may have downloaded my app from the app store. In any event, the current version of the app on my phone is a development version (through Xcode, not app store). Other development apps show up in the Organizer, but not my released app. Since I don't want to lose the data associated with the app, I can't just delete the app, and re-install through Xcode. Suggestions?
If you coded your app to save the data to the app's Application Documents directly you can use a tool like PhoneDisk (or the newer iExplorer - http://www.macroplant.com/phonedisk/) to access your device and copy the contents from the documents folder to your desktop (or wherever).
Often times when we build apps with databases and we want to make sure users can easily backup, transfer, and/or email the DB to customer support so we enable iTunes file sharing.
This allows users to open iTunes, choose their device, select the Apps tab, then scroll down to the File Sharing section. From there the user can select any file located in the documents folder and easily copy the files to/from the device via iTunes.
To do this, you must enable Application Supports iTunes File Sharing by adding the same key and setting the BOOL value to YES in the *-Info.plist file for your application.

Timeline for mac sandbox entitlements and related features

I understand that sandbox was introduced in Mac OS X Lion (10.7) but temporary exception entitlements, specifically com.apple.security.temporary-exception.files.home-relative-path.read-write, were introduced in a later 10.7.x update (which one?)
Similarly security scoped bookmarks were introduced in 10.7.3.
My Mac app (not currently sandboxed) is a document based app that creates documents that have references to pictures on users' mac. Once a user uses some pictures in his document we simply save the path (for eg. /Users/myname/Desktop/pic.jpg) of used picture in that document. When a user quits the app and reopens the saved document, our app can simply get access to the picture using the path from the document. Since our app is not sandboxed this works on all versions 10.6.x, 10.7.x, and 10.8.x
We would now like to sandbox our app and ensure that it continues to work on all versions (10.6.x, 10.7.x, and 10.8.x) of Mac OS X. To achieve this, we will
Ask for a temporary exception entitlement, specifically com.apple.security.temporary-exception.files.absolute-path.read-write and this will enable random file access for 10.7.3 onwards. But what do we do for 10.7, 10.7.1, and 10.7.2?
Beyond 10.7.3 we will start using security scoped bookmarks.

Resources