Re: APN and various apps determining each other present on a device?
On Oct 3, 2012, at 19:46 , Jeff Kelley wrote: > It’s relatively simple: App A registers for a URL scheme, let’s say AppA://. > App B asks the system if it knows how to handle AppA:// links. I was looking for how this is done. How does an app ask? I found a document that's supposed to cover this, but doesn't. Furthermore, can Javascript ask the same question? -- Rick ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: APN and various apps determining each other present on a device?
It’s relatively simple: App A registers for a URL scheme, let’s say AppA://. App B asks the system if it knows how to handle AppA:// links. Jeff Kelley On Oct 3, 2012, at 10:36 PM, William Squires wrote: > Let's say a company, IMakeGamesCo, has several games in the App Store (iOS). > Is there an API for determining (from one app) if another app from the same > developer is installed? I'm guessing "yes" because I've seen several apps > that can do this; most of them by PocketGems (example: Tap Paradise Cove can > tell if you installed Tap Campus Life, and give you a reward for completing a > quest in Paradise Cove if you complete some other quest in Campus Life. Or is > this just all server-side? Is this part of APN (push notifications)? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
APN and various apps determining each other present on a device?
Let's say a company, IMakeGamesCo, has several games in the App Store (iOS). Is there an API for determining (from one app) if another app from the same developer is installed? I'm guessing "yes" because I've seen several apps that can do this; most of them by PocketGems (example: Tap Paradise Cove can tell if you installed Tap Campus Life, and give you a reward for completing a quest in Paradise Cove if you complete some other quest in Campus Life. Or is this just all server-side? Is this part of APN (push notifications)? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
NSURLConnection working OK on iOS 6?
Anybody extensively using NSURLConnection seeing more failure with timed outs with devices running on iOS 6? -Laurent. -- Laurent Daudelin AIM/iChat/Skype:LaurentDaudelin http://www.nemesys-soft.com/ Logiciels Nemesys Software laur...@nemesys-soft.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Suggestions for handling old document files with file paths in a sandbox environment
On Oct 3, 2012, at 14:02 , Marshall Houskeeper wrote: > I have no problem with the use of the open panel ( security-scoped bookmark > )for creating new documents. OK, understood. > The problem is for pre sandboxed documents or documents that come from > Windows. Having the user re-authorize each external file would be very > problematic and time consuming. Putting the two halves of what I said together, the question is how many uses of the open panel (or Windows equivalent) did it originally take to produces these older documents? Thousands? My guess is not thousands -- thousands of files may be referenced, but there were many fewer "add" operations involved (either because the user added a folder, or added one file which implied the locations of other files). It seems to me you'd need to reduce the thousands of files references to a much smaller number of re-constructed "user-did-add" operations which would, yes, have to be individually reauthorized. This would, in many case, mean you were creating bookmarks for enclosing folders rather than files. > What I am looking for are suggestions to best handle or avoid the > re-authorization of each embedded file reference. One option may be to write > a non sandbox application that would take the non sandboxed document and > convert the file references to security-scoped bookmarks if this is allowed. I don't believe it's possible. If it were, sandbox security could easily be bypassed by malicious software. If there's no practical way to reduce the re-authorizations to a manageable number, then I think you must follow Sean's suggestion of getting a temporary entitlement for your app that allows it to read anywhere in the file system, using the need for compatibility with older documents as your reason. You *might* in this case be able to "convert" older documents to use security-scoped bookmarks, under the aegis of the temporary entitlement, but I admit I don't know whether there are constraints on bookmarks in this case. (It also means your users will need to convert their old documents before the temporary entitlement is deprecated sometime in the future, as I'm sure it will eventually be.) ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Suggestions for handling old document files with file paths in a sandbox environment
Hi Quincey, I have no problem with the use of the open panel ( security-scoped bookmark )for creating new documents. The problem is for pre sandboxed documents or documents that come from Windows. Having the user re-authorize each external file would be very problematic and time consuming. What I am looking for are suggestions to best handle or avoid the re-authorization of each embedded file reference. One option may be to write a non sandbox application that would take the non sandboxed document and convert the file references to security-scoped bookmarks if this is allowed. Note; I am not trying to start a sandbox flame war. Marshall On Oct 3, 2012, at 4:34 PM, Quincey Morris wrote: > On Oct 3, 2012, at 12:44 , Marshall Houskeeper > wrote: > >> Our plan is to use Security-Scoped Bookmarks for all new documents to store >> external file references when we go to the sandbox environment. In our use >> case, I would guess that none of the external referenced files would be >> stored in our sandbox. > > What I'm saying is, for all *new* documents, you can't create security-scoped > bookmarks unless the user has authorized each (via the open panel). Thus, > even for future documents, if they contain thousands of references via > bookmarks, then you would have had to get them through the open panel > thousands of times. > > Of course, this is the worst case. If the user is actually adding (say) > hundreds of files from a single folder, then presumably you'd might have the > user choose the folder and create a bookmark to the folder rather than the > files. > > But the point is that AFAIK: > > 1 security-scoped bookmark == 1 visit to the open panel > > Depending what your app is actually doing, this might be painful for users. > In the Final Cut scenario which Sean mentioned, I'd assume there *is* a visit > to the open panel for adding each asset (or asset folder) to the project. But > that was true even before sandboxing entered the picture -- sandboxing > doesn't really add anything new (except perhaps to force re-authorization of > locations for items in existing projects, one time). > > ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Suggestions for handling old document files with file paths in a sandbox environment
On Oct 3, 2012, at 12:44 , Marshall Houskeeper wrote: > Our plan is to use Security-Scoped Bookmarks for all new documents to store > external file references when we go to the sandbox environment. In our use > case, I would guess that none of the external referenced files would be > stored in our sandbox. What I'm saying is, for all *new* documents, you can't create security-scoped bookmarks unless the user has authorized each (via the open panel). Thus, even for future documents, if they contain thousands of references via bookmarks, then you would have had to get them through the open panel thousands of times. Of course, this is the worst case. If the user is actually adding (say) hundreds of files from a single folder, then presumably you'd might have the user choose the folder and create a bookmark to the folder rather than the files. But the point is that AFAIK: 1 security-scoped bookmark == 1 visit to the open panel Depending what your app is actually doing, this might be painful for users. In the Final Cut scenario which Sean mentioned, I'd assume there *is* a visit to the open panel for adding each asset (or asset folder) to the project. But that was true even before sandboxing entered the picture -- sandboxing doesn't really add anything new (except perhaps to force re-authorization of locations for items in existing projects, one time). ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Suggestions for handling old document files with file paths in a sandbox environment
Our plan is to use Security-Scoped Bookmarks for all new documents to store external file references when we go to the sandbox environment. In our use case, I would guess that none of the external referenced files would be stored in our sandbox. The problem that I have is opening old documents that where created pre sandboxing or documents that where created on Windows and copied to the Mac with their associated external files. I would be very interested in knowing how Final Cut plans to handle similar problems. Marshall On Oct 3, 2012, at 2:38 PM, Quincey Morris wrote: > On Oct 3, 2012, at 11:06 , Charles Srstka wrote: > >> is there a way to just ask for permission to open a specific file and have >> a "Cancel or allow" box come up > > You can use the 'NSOpenSavePanelDelegate' protocol to validate whatever the > user chooses, or you can just validate the returned URL when the open panel > is completed. There's no way to tell the panel to freeze itself on a specific > file. > > > On Oct 3, 2012, at 08:15 , Marshall Houskeeper > wrote: > >> When we move to a sandbox environment, we will store Security-Scoped >> Bookmarks. > > > In the absence of further information, I don't see how this plan to store > bookmarks is going to work. You can only create security-scoped bookmarks to > items you have access to. > > If an item is in your sandbox, you don't need the bookmark at all (for > security reasons, anyway). If the item is *not* in your sandbox, then you're > going to have to ask the user for access -- possibly thousands of times. > > ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Suggestions for handling old document files with file paths in a sandbox environment
On Oct 3, 2012, at 1:38 PM, Quincey Morris wrote: > On Oct 3, 2012, at 11:06 , Charles Srstka wrote: > >> is there a way to just ask for permission to open a specific file and have >> a "Cancel or allow" box come up > > You can use the 'NSOpenSavePanelDelegate' protocol to validate whatever the > user chooses, or you can just validate the returned URL when the open panel > is completed. There's no way to tell the panel to freeze itself on a specific > file. That sounds like a recipe for some really confusing UI... Charles ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Suggestions for handling old document files with file paths in a sandbox environment
On Wed, 3 Oct 2012 11:38:10 -0700, Quincey Morris said: >If an item is in your sandbox, you don't need the bookmark at all (for >security reasons, anyway). If the item is *not* in your sandbox, then >you're going to have to ask the user for access -- possibly thousands of >times. Which is of course ridiculous. Can you imagine Final Cut Pro or Xcode doing such a thing when opening their old documents? Notice Apple hasn't sandboxed those applications? My solution for now is: com.apple.security.temporary-exception.files.absolute-path.read-write / /Volumes/ You still get some benefit from the sandbox (protection against network, USB, camera being compromised), but have full file system access. If you care about App Store (I don't), they may not allow this. Cheers, -- Sean McBride, B. Eng s...@rogue-research.com Rogue Researchwww.rogue-research.com Mac Software Developer Montréal, Québec, Canada ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Suggestions for handling old document files with file paths in a sandbox environment
On Oct 3, 2012, at 11:06 , Charles Srstka wrote: > is there a way to just ask for permission to open a specific file and have a > "Cancel or allow" box come up You can use the 'NSOpenSavePanelDelegate' protocol to validate whatever the user chooses, or you can just validate the returned URL when the open panel is completed. There's no way to tell the panel to freeze itself on a specific file. On Oct 3, 2012, at 08:15 , Marshall Houskeeper wrote: > When we move to a sandbox environment, we will store Security-Scoped > Bookmarks. In the absence of further information, I don't see how this plan to store bookmarks is going to work. You can only create security-scoped bookmarks to items you have access to. If an item is in your sandbox, you don't need the bookmark at all (for security reasons, anyway). If the item is *not* in your sandbox, then you're going to have to ask the user for access -- possibly thousands of times. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Suggestions for handling old document files with file paths in a sandbox environment
On Oct 3, 2012, at 12:18 PM, Sean McBride wrote: > On Wed, 3 Oct 2012 11:15:48 -0400, Marshall Houskeeper said: > >> Our document file format currently stores file paths and file alias to >> external files. We can potentially have several thousand references to >> external files stored in a document. When we move to a sandbox >> environment, we will store Security-Scoped Bookmarks. >> >> What is the suggested method to handling old documents with with >> external file references in a sandbox environment? > > I'm afraid the only choice seems to be: display an NSOpenPanel for each file. This may be a dumb question, as I haven't worked with the sandbox much and am somewhat ignorant of it, but is there a way to just ask for permission to open a specific file and have a "Cancel or allow" box come up, or is the only option to run a standard NSOpenPanel and run the risk that the user might change the file that's selected before dismissing it? If so, how does one do that? I don't see anything in the NSOpenPanel docs. Charles ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Suggestions for handling old document files with file paths in a sandbox environment
On Wed, 3 Oct 2012 11:15:48 -0400, Marshall Houskeeper said: >Our document file format currently stores file paths and file alias to >external files. We can potentially have several thousand references to >external files stored in a document. When we move to a sandbox >environment, we will store Security-Scoped Bookmarks. > >What is the suggested method to handling old documents with with >external file references in a sandbox environment? I'm afraid the only choice seems to be: display an NSOpenPanel for each file. I wonder how Final Cut Pro will deal with this (and when it will get sandboxed.) Do file a bug, and pray. Cheers, -- Sean McBride, B. Eng s...@rogue-research.com Rogue Researchwww.rogue-research.com Mac Software Developer Montréal, Québec, Canada ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Suggestions for handling old document files with file paths in a sandbox environment
Our document file format currently stores file paths and file alias to external files. We can potentially have several thousand references to external files stored in a document. When we move to a sandbox environment, we will store Security-Scoped Bookmarks. What is the suggested method to handling old documents with with external file references in a sandbox environment? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSOperationQueue and for-loop
On 3 Oct 2012, at 14:17, Koen van der Drift wrote: > On Wed, Oct 3, 2012 at 9:03 AM, Koen van der Drift > wrote: > Good point, thanks. So are there any workarounds for that? I'm sure >> this pattern (doing lots of calculations concurrently, and store the >> results in a common object for later), is used in other situations as >> well. > > From a quick search, would this work in my situation (will try later): > > @synchronized(temp) { > [temp addObject: newObj]; > } Yes, your options boil down to: - some kind of lock, as in your example - shunting the -addObject: call off onto a serial queue/thread ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSOperationQueue and for-loop
On Wed, Oct 3, 2012 at 9:03 AM, Koen van der Drift wrote: Good point, thanks. So are there any workarounds for that? I'm sure > this pattern (doing lots of calculations concurrently, and store the > results in a common object for later), is used in other situations as > well. >From a quick search, would this work in my situation (will try later): @synchronized(temp) { [temp addObject: newObj]; } Thanks, - Koen. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSOperationQueue and for-loop
On Wed, Oct 3, 2012 at 8:48 AM, Mike Abdullah wrote: > Regardless, your posted code is going to blow up sooner or later. NSMutableArray is not safe to modify from more than a single thread at a time. If two of your worker blocks happen to finish at the same time and call -addObject: together, nasty things will happen. > Good point, thanks. So are there any workarounds for that? I'm sure this pattern (doing lots of calculations concurrently, and store the results in a common object for later), is used in other situations as well. - Koen. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSOperationQueue and for-loop
On 3 Oct 2012, at 13:37, Koen van der Drift wrote: > On Tue, Oct 2, 2012 at 10:30 PM, Koen van der Drift > wrote: > >>> Thanks, I'll Google for some examples. For now, I still get an >>> EXC_BAD_ACCESS (code=13, address = 0x0) error in one of the threads after >>> several iterations. Some more digging reveals:*** -[MyObject setPosition:]: >>> message sent to deallocated instance 0x1075a6480. This address is the >>> current MyObject, and only one is created during each iteration. >> >> It's all very confusing still. I'll keep looking. > > > I'm not at my Mac right now (I have a non-programming daytime job), > but I think I know what could be going on. This is some code (typed in > email program) very similar to what I did so far and which was causing > the crashes: > > NSUInteger __block i, j,; > MyObject __block *newObj; > > NSMutabbleArray*temp = [[NSMutableArray alloc] init]; > NSOperationQueue *q = [[NSOperationQueue alloc] init]; > > for (i = 0; i < 10; i++) { > [q addOperationWithBlock: ^{ > for (j=1; j < 5; j++) { > newObj = [MyObject alloc] init]; > [newObj doSomething: i]; > [newObj doSomethingElse: j]; > > [temp addObject: newObj]; > } > }]; > } > > [q waitUntilAllOperationsAreFinished]; > [self updateUIWithArray: temp]; > > The crash would always occur at one of the doSomething calls, and is > related to newObj already being dellocated ("message sent to > deallocated instance"). So maybe with all those thread going on, > newObj somehow gets re-used before it was added to temp. > > So I see two solutions: 1) add a copy of newObj to temp, or 2) put > the declaration of newObj inside the inner for loop. > > I won't be able to test it until later, but am I on the right track here? > > Also, is waitUntilAllOperationsAreFinished needed to make sure all > iterations are completed before moving on to update the UI? Regardless, your posted code is going to blow up sooner or later. NSMutableArray is not safe to modify from more than a single thread at a time. If two of your worker blocks happen to finish at the same time and call -addObject: together, nasty things will happen. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSOperationQueue and for-loop
On Tue, Oct 2, 2012 at 10:30 PM, Koen van der Drift wrote: >> Thanks, I'll Google for some examples. For now, I still get an >> EXC_BAD_ACCESS (code=13, address = 0x0) error in one of the threads after >> several iterations. Some more digging reveals:*** -[MyObject setPosition:]: >> message sent to deallocated instance 0x1075a6480. This address is the >> current MyObject, and only one is created during each iteration. > > It's all very confusing still. I'll keep looking. I'm not at my Mac right now (I have a non-programming daytime job), but I think I know what could be going on. This is some code (typed in email program) very similar to what I did so far and which was causing the crashes: NSUInteger __block i, j,; MyObject __block *newObj; NSMutabbleArray*temp = [[NSMutableArray alloc] init]; NSOperationQueue *q = [[NSOperationQueue alloc] init]; for (i = 0; i < 10; i++) { [q addOperationWithBlock: ^{ for (j=1; j < 5; j++) { newObj = [MyObject alloc] init]; [newObj doSomething: i]; [newObj doSomethingElse: j]; [temp addObject: newObj]; } }]; } [q waitUntilAllOperationsAreFinished]; [self updateUIWithArray: temp]; The crash would always occur at one of the doSomething calls, and is related to newObj already being dellocated ("message sent to deallocated instance"). So maybe with all those thread going on, newObj somehow gets re-used before it was added to temp. So I see two solutions: 1) add a copy of newObj to temp, or 2) put the declaration of newObj inside the inner for loop. I won't be able to test it until later, but am I on the right track here? Also, is waitUntilAllOperationsAreFinished needed to make sure all iterations are completed before moving on to update the UI? - Koen. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com