CALayer's geometryFlipped is initially reset to Layer-Hosting NSView's isFlipped when linked agains 10.8
I've noticed that if an app is built against ML SDK, the geometryFlipped property is initially reset to NSView's isFlipped. Initially means at some point after view is added to the hierarchy. By reset I mean it discrads previously set value. However it's not bound to the isFlipped property. You are free to change it after some time. Is it intended behavior? Best regards, Ilya Kulakov ___ 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
default "synchronous" and "full_fsync" of Core Data Sqlite on iOS
Hi All, I read Apple's documentation "Core Data Programming Guide" recently. In chapter "Persistent Store Features" section "Configuring a SQLite Store’s Save Behavior" , they talked about different behavior of SQlite options "synchronous" and "full_fsync" on different version of Mac. However the default option on different version of iOS is not mentioned, Does anyone here have any idea about it ? It would be much better if I could know the way to verify your answer. Thanks in advance ! Regards, Bob ___ 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: Open untitled file in Document-based app
On Tue, Oct 23, 2012 at 11:58 PM, Graham Cox wrote: > > If you return YES from -applicationOpenUntitledFile: the application will > NOT open a new file - it has assumed that this method has done it and by > returning YES that's what you're telling it. You want to either return NO > or else not override this method at all. > > Thanks for the reply! I tried both to return NO and to not overriding the method but it still wont open any window at start up. The method(s) are not even called..? I think it has something to do with 10.8 restoring the previous state but I'm not sure how to force it to open an window if there was no window at application exit. ___ 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: Security-scoped bookmarks linked to code signing?
On 24 Oct 2012, at 02:28, Graham Cox wrote: > I'm using security-scoped bookmarks to save the location of certain folders > between launches so that my sandboxed app works properly. > > We've had reports that resolving these bookmarks sometimes crashes deep > inside the security-scoping resolution but I have been unable to reproduce > this. But one clue is that the apps that exhibit this problem were > incorrectly codesigned (using the wrong developer certificate), and I was > wondering if there was a connection between resolving SS bookmarks and > codesigning. If there is that's probably the answer, but if not I'll know to > keep looking for another reason. Handling security-scoped bookmarks most certainly relies upon code-signing, as without you can’t create or resolve them. Are you dealing with app or document scoped bookmarks here? ___ 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: App Sandbox Container or Data Directory
On 23 Oct 2012, at 23:06, Richard Somers wrote: > On Oct 23, 2012, at 2:43 PM, Kyle Sluder wrote: > >> If by "unapproved" you mean "my app's sandbox hasn't been extended to >> include this path" then you are incorrect. The user can choose the >> destination, and the NSURL you get back from the open panel will carry >> the rights to access that location. >> >> If by "unapproved" you mean "the user my app is running as doesn't have >> write permission to this location", then yes that is expected behavior. > > I sandboxed my app in Xcode. In the app target entitlement area there are > access control options for Music, Movies, Pictures, and Downloads folders. > Access to these folders remained the default "No Access". I launched the app > and and saved a new document. In the save panel the Music folder was showing > as a Recent Place. I selected this as the save location and saving was a > success. As a developer, based on the entitlement settings, I was expecting > failure. If the user can get to it in a save panel, that should override anything else your app has setup. Any other way would be madness. > > Saving a new document to the users home directory (choose the home directory > in the save panel) resulted in failure. "The document could not be saved. You > don't have permission." As a developer this is what I expected. From a users > point of view I was surprised that the save panel let the user choose a > location where a save was not allowed and subsequently would result in > failure. This is the surprising bit. You do have the com.apple.security.files.user-selected.read-write entitlement set, yes? ___ 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: CALayer's geometryFlipped is initially reset to Layer-Hosting NSView's isFlipped when linked agains 10.8
On Oct 22, 2012, at 6:58 PM, Илья Кулаков wrote: > I've noticed that if an app is built against ML SDK, the geometryFlipped > property is initially reset to NSView's isFlipped. > Initially means at some point after view is added to the hierarchy. By reset > I mean it discrads previously set value. > > However it's not bound to the isFlipped property. You are free to change it > after some time. > > Is it intended behavior? I'm assuming you asked this on the dev forums while your post here was sitting in the moderation queue. To repeat for everyone else: the answer is "yes". More info can be found in the AppKit 10.8 release notes. --Kyle Sluder ___ 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
Plan for persisting preferences on iOS applications
We're currently looking at expanding one of our applications from 1 office to up to 40. It's an app that needs an internal preference to be set and remembered through updates or reinstalls. Since (thanks to the joys of sandboxing), preferences can't be saved outside the app in the preferences folder, I'm expecting to either get a UUID, or MAC address of the device, registering it and the device's name off in a mySQL database and fetching this information on load every time and saving as a pList if the pList doesn't exist, or if the pList contents are different from what is fetched. It sure sounds like a valid approach, but is this the best approach? Since standard policy with many companies is that no corporate data can exist outside the corporate network, using iCloud is out of the question. Thanks in advance. - Alex Zavatone ___ 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: Plan for persisting preferences on iOS applications
This doesn't answer your question, but it might not be against company policies to encrypt the data and store the ciphertext in iCloud. On 2012-10-24, at 11:24 AM, Alex Zavatone wrote: > We're currently looking at expanding one of our applications from 1 office to > up to 40. > > It's an app that needs an internal preference to be set and remembered > through updates or reinstalls. > > Since (thanks to the joys of sandboxing), preferences can't be saved outside > the app in the preferences folder, I'm expecting to either get a UUID, or MAC > address of the device, registering it and the device's name off in a mySQL > database and fetching this information on load every time and saving as a > pList if the pList doesn't exist, or if the pList contents are different from > what is fetched. > > It sure sounds like a valid approach, but is this the best approach? > > Since standard policy with many companies is that no corporate data can exist > outside the corporate network, using iCloud is out of the question. > > Thanks in advance. > - Alex Zavatone > ___ > > 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/dave.fernandes%40utoronto.ca > > This email sent to dave.fernan...@utoronto.ca ___ 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: Plan for persisting preferences on iOS applications
On 24 Oct 2012, at 16:24, Alex Zavatone wrote: > We're currently looking at expanding one of our applications from 1 office to > up to 40. > > It's an app that needs an internal preference to be set and remembered > through updates or reinstalls. I’m confused, what stops a regular preference from persisting across updates and reinstalls? ___ 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: Plan for persisting preferences on iOS applications
On Oct 24, 2012, at 12:40 PM, Mike Abdullah wrote: > > On 24 Oct 2012, at 16:24, Alex Zavatone wrote: > >> We're currently looking at expanding one of our applications from 1 office >> to up to 40. >> >> It's an app that needs an internal preference to be set and remembered >> through updates or reinstalls. > > I’m confused, what stops a regular preference from persisting across updates > and reinstalls? Well, according to the docs, the preferences folder is within the app. Therefore, when replacing the app, (which is a folder) the entire contents of the app would be expected to be replaced. To anyone who has been using a Mac since they came out and knows how folders work, this is the expected behaviour. Nothing I have read has told me otherwise. Why would an app's contents be preserved on a fresh install? And if they would be preserved on a fresh install, where is this documented so that we know where to find information like this. Thanks man. ___ 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: Open untitled file in Document-based app
On Wed, 24 Oct 2012 11:05:20 +0200, ecir hana said: >I tried both to return NO and to not overriding the method but it still >wont open any window at start up. The method(s) are not even called..? I >think it has something to do with 10.8 restoring the previous state but I'm >not sure how to force it to open an window if there was no window at >application exit. That restoring state stuff is new in 10.7, not 10.8. You can test if it is responsible by turning it off in System Preferences > General. 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: Plan for persisting preferences on iOS applications
On Oct 24, 2012, at 10:03 AM, Alex Zavatone wrote: > > On Oct 24, 2012, at 12:40 PM, Mike Abdullah wrote: > >> >> On 24 Oct 2012, at 16:24, Alex Zavatone wrote: >> >>> We're currently looking at expanding one of our applications from 1 office >>> to up to 40. >>> >>> It's an app that needs an internal preference to be set and remembered >>> through updates or reinstalls. >> >> I’m confused, what stops a regular preference from persisting across updates >> and reinstalls? > > Well, according to the docs, the preferences folder is within the app. > Therefore, when replacing the app, (which is a folder) the entire contents of > the app would be expected to be replaced. The docs describe the sandbox configuration (or should) which does not say that preferences are inside the application, but rather inside the application's sandbox. The distinction is huge (if only because if it was inside the application your application's signature would break and would no longer launch). Nothing except deleting the application (nee its sandbox) should delete existing preferences. -- David Duncan ___ 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: Plan for persisting preferences on iOS applications
On Oct 24, 2012, at 1:13 PM, David Duncan wrote: > On Oct 24, 2012, at 10:03 AM, Alex Zavatone wrote: > >> >> On Oct 24, 2012, at 12:40 PM, Mike Abdullah wrote: >> >>> >>> On 24 Oct 2012, at 16:24, Alex Zavatone wrote: >>> We're currently looking at expanding one of our applications from 1 office to up to 40. It's an app that needs an internal preference to be set and remembered through updates or reinstalls. >>> >>> I’m confused, what stops a regular preference from persisting across >>> updates and reinstalls? >> >> Well, according to the docs, the preferences folder is within the app. >> Therefore, when replacing the app, (which is a folder) the entire contents >> of the app would be expected to be replaced. > > The docs describe the sandbox configuration (or should) which does not say > that preferences are inside the application, but rather inside the > application's sandbox. The distinction is huge (if only because if it was > inside the application your application's signature would break and would no > longer launch). > > Nothing except deleting the application (nee its sandbox) should delete > existing preferences. > -- > David Duncan > That's just amazing. Apple's doc writers need to do a much better job of explaining that even though the app is sandboxed, the sandbox exists outside the application and the app and the sandbox folders sit next to it within a folder that holds them all. Or does it? Since the app itself is referred to as a folder and the Documents, Library and tmp folders for an app belong to that, it's not obvious that the folders sit within a folder that contains the app, but at the same level as the app itself. And with the removal of access to the /preferences folder, it is way too easy to make the assumption that it's impossible to save application specific data that will not persist if the app gets updated. Thank you for making me look at this again. App folder structure is a little more clear to me. ___ 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: Plan for persisting preferences on iOS applications
On Oct 24, 2012, at 10:25 AM, Alex Zavatone wrote: > > On Oct 24, 2012, at 1:13 PM, David Duncan wrote: > >> On Oct 24, 2012, at 10:03 AM, Alex Zavatone wrote: >> >>> >>> On Oct 24, 2012, at 12:40 PM, Mike Abdullah wrote: >>> On 24 Oct 2012, at 16:24, Alex Zavatone wrote: > We're currently looking at expanding one of our applications from 1 > office to up to 40. > > It's an app that needs an internal preference to be set and remembered > through updates or reinstalls. I’m confused, what stops a regular preference from persisting across updates and reinstalls? >>> >>> Well, according to the docs, the preferences folder is within the app. >>> Therefore, when replacing the app, (which is a folder) the entire contents >>> of the app would be expected to be replaced. >> >> The docs describe the sandbox configuration (or should) which does not say >> that preferences are inside the application, but rather inside the >> application's sandbox. The distinction is huge (if only because if it was >> inside the application your application's signature would break and would no >> longer launch). >> >> Nothing except deleting the application (nee its sandbox) should delete >> existing preferences. >> -- >> David Duncan >> > > That's just amazing. Apple's doc writers need to do a much better job of > explaining that even though the app is sandboxed, the sandbox exists outside > the application and the app and the sandbox folders sit next to it within a > folder that holds them all. Or does it? Without knowing which documentation you allude to, I can't really say what the issue here is. I can only say that in every document on the sandbox structure that I'm aware of, it shows the application as in the sandbox and next to everything else. If you think something is unclear, feel free to provide feedback or file a bug report. > Since the app itself is referred to as a folder and the Documents, Library > and tmp folders for an app belong to that, it's not obvious that the folders > sit within a folder that contains the app, but at the same level as the app > itself. And with the removal of access to the /preferences folder, it is way > too easy to make the assumption that it's impossible to save application > specific data that will not persist if the app gets updated. > > Thank you for making me look at this again. App folder structure is a little > more clear to me. > > > > -- David Duncan ___ 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: Plan for persisting preferences on iOS applications
On Oct 24, 2012, at 10:25 AM, Alex Zavatone wrote: > That's just amazing. Apple's doc writers need to do a much better job of > explaining that even though the app is sandboxed, the sandbox exists outside > the application and the app and the sandbox folders sit next to it within a > folder that holds them all. Or does it? We're you reading the iOS docs by mistake? The Mac docs make it quite clear that the sandbox container lives in ~/Library/Containers. --Kyle Sluder ___ 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: Plan for persisting preferences on iOS applications
On Oct 24, 2012, at 1:36 PM, David Duncan wrote: >> ... >> That's just amazing. Apple's doc writers need to do a much better job of >> explaining that even though the app is sandboxed, the sandbox exists outside >> the application and the app and the sandbox folders sit next to it within a >> folder that holds them all. Or does it? > > Without knowing which documentation you allude to, I can't really say what > the issue here is. I can only say that in every document on the sandbox > structure that I'm aware of, it shows the application as in the sandbox and > next to everything else. If you think something is unclear, feel free to > provide feedback or file a bug report. I'll admit that I poured over the Sandboxing docs about 6 months ago. Not sure what's changed, if anything. Looking at it from an educated developer perspective, I can see that the current docs make perfect sense. To those who have been using Macs for the past 25 years, but not explicitly coding in OC until the past few, there needs to be a little more detail. There is a nice illustration at the bottom of the screen here that shows the app structure: http://developer.apple.com/library/ios/#documentation/iphone/conceptual/iphoneosprogrammingguide/TheiOSEnvironment/TheiOSEnvironment.html When that illustration is not in front of you, the doc that I read 6 months ago shows the folders that the app has access to under the hierarchy of the app and since the app itself is a folder, it's all to easy to make the mental jump that those folders exist within the app itself. I'll try to find those docs and offer feedback to make things a little more clear. Thanks Dave. >> Since the app itself is referred to as a folder and the Documents, Library >> and tmp folders for an app belong to that, it's not obvious that the folders >> sit within a folder that contains the app, but at the same level as the app >> itself. And with the removal of access to the /preferences folder, it is >> way too easy to make the assumption that it's impossible to save application >> specific data that will not persist if the app gets updated. >> >> Thank you for making me look at this again. App folder structure is a >> little more clear to me. >> >> >> >> > > -- > David Duncan > ___ 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: Plan for persisting preferences on iOS applications
I'm referring to the iOS docs. Sorry if I didn't specify that this was for iOS. On Oct 24, 2012, at 1:59 PM, Kyle Sluder wrote: > On Oct 24, 2012, at 10:25 AM, Alex Zavatone wrote: > >> That's just amazing. Apple's doc writers need to do a much better job of >> explaining that even though the app is sandboxed, the sandbox exists outside >> the application and the app and the sandbox folders sit next to it within a >> folder that holds them all. Or does it? > > We're you reading the iOS docs by mistake? The Mac docs make it quite clear > that the sandbox container lives in ~/Library/Containers. > > --Kyle Sluder ___ 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: Open untitled file in Document-based app
On Wed, Oct 24, 2012 at 7:13 PM, Sean McBride wrote: > > That restoring state stuff is new in 10.7, not 10.8. You can test if it > is responsible by turning it off in System Preferences > General. > > Yes, it is! When I turn it off (Close windows when quitting an application) it works as before. Is it possible to have the same behavior even when a user has the restoring state stuff enabled? ___ 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: Running a-foul of bindings with multiple-value subfields
On 2012 Oct 23, at 10:09, Erik Stainsby wrote: > My question is ought I to be using (or subclassing) an arrayController for > each of these lists ? And then binding through the selectedIndex or some such > ? You're getting into murky waters there, Erik. I Subclassing will probably not help. As a first try, bind an array controller's 'Content Array' binding to one of the collection attributes, or as you say "list" attributes of your "person" class. ___ 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
Need help passing a Secure Bookmark to an XPC Service
Hi All, I am sending a NSURL, encoded as a Secure Bookmark, from the main part of my sandboxed application to an XPC Service that handles a specific subtask. The data is making it across the interface, but when I try to resolve the bookmark back into an NSURL, I get the following error: 10/24/12 5:15:18.908 PM com.einsteinslegacy.silica.silicaHelper: --- bookmark error: Error Domain=NSCocoaErrorDomain Code=259 "The file couldn’t be opened because it isn’t in the correct format." UserInfo=0x7faf418069a0 {} Googling the text of the error message has not lead to any useful insights. Here's what I'm doing: • When a user selects a file, I create an object containing the URL and the associated secure bookmark. • I use NSKeyedArchive to create a data object, which I then pass to the XPC service as a key-value pair in an xpc_dictionary. • The XPC service receives the message, unpacks it and calls NSKeyedUnarchiver to reconstitute the URL from the secure bookmark. At this point, I check the length of the bookmark data. The value matches the length of the originally encoded bookmark. However, when I try to resolve the URL using the following line of code, I get nil. self.url = [NSURL URLByResolvingBookmarkData: self.bookmark options: NSURLBookmarkResolutionWithSecurityScope relativeToURL: nil bookmarkDataIsStale: &isStale error: &bookmarkError]; The entitlements file used for the XPC Service is a duplicate of the main application file. The XPCService dictionary in the service's info.plist has "JoinExistingSession" set to YES, so I assume that both parts should have the same set of entitlements. Are there other factors I need to consider when passing secure bookmarks? curiously, douglas ___ 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: Need help passing a Secure Bookmark to an XPC Service
On 24 Oct 2012, at 22:56, douglas welton wrote: > Hi All, > > I am sending a NSURL, encoded as a Secure Bookmark, from the main part of my > sandboxed application to an XPC Service that handles a specific subtask. The > data is making it across the interface, but when I try to resolve the > bookmark back into an NSURL, I get the following error: > > 10/24/12 5:15:18.908 PM com.einsteinslegacy.silica.silicaHelper: --- > bookmark error: Error Domain=NSCocoaErrorDomain Code=259 "The file couldn’t > be opened because it isn’t in the correct format." UserInfo=0x7faf418069a0 {} > > Googling the text of the error message has not lead to any useful insights. > > Here's what I'm doing: > > • When a user selects a file, I create an object containing the URL and the > associated secure bookmark. > • I use NSKeyedArchive to create a data object, which I then pass to the XPC > service as a key-value pair in an xpc_dictionary. > • The XPC service receives the message, unpacks it and calls > NSKeyedUnarchiver to reconstitute the URL from the secure bookmark. > > At this point, I check the length of the bookmark data. The value matches > the length of the originally encoded bookmark. However, when I try to > resolve the URL using the following line of code, I get nil. > > self.url = [NSURL URLByResolvingBookmarkData: self.bookmark options: > NSURLBookmarkResolutionWithSecurityScope relativeToURL: nil > bookmarkDataIsStale: &isStale error: &bookmarkError]; > > The entitlements file used for the XPC Service is a duplicate of the main > application file. The XPCService dictionary in the service's info.plist has > "JoinExistingSession" set to YES, so I assume that both parts should have the > same set of entitlements. > > Are there other factors I need to consider when passing secure bookmarks? You don’t need a security-scoped bookmark for this. Regular bookmarks carry access to the file until the computer next reboots. ___ 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: Security-scoped bookmarks linked to code signing?
On 24/10/2012, at 8:47 PM, Mike Abdullah wrote: > Handling security-scoped bookmarks most certainly relies upon code-signing, > as without you can’t create or resolve them. Are you dealing with app or > document scoped bookmarks here? > App-scoped. In dev and testing no problem was encountered but "in the wild" we have this crash deep within -[NSURL URLByResolvingBookmarkData:options:.]. The app was incorrectly signed due to a stuff-up with the developer ID certs which was resolved, but that won't help until we get an update published. What's annoying is that the bookmark resolving just crashes rather than handle the problem gracefully, and we're still not certain whether the incorrect signing is the real cause or not (the apps were signed, just not using the correct cert). This deep connection between parts of the OS that behave very differently according to the situation they find themselves in is a recipe for very hard-to-find bugs that easily escape QA. --Graham ___ 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: Security-scoped bookmarks linked to code signing?
On 24 Oct 2012, at 23:31, Graham Cox wrote: > > On 24/10/2012, at 8:47 PM, Mike Abdullah wrote: > >> Handling security-scoped bookmarks most certainly relies upon code-signing, >> as without you can’t create or resolve them. Are you dealing with app or >> document scoped bookmarks here? >> > > > App-scoped. > > In dev and testing no problem was encountered but "in the wild" we have this > crash deep within -[NSURL URLByResolvingBookmarkData:options:.]. The app > was incorrectly signed due to a stuff-up with the developer ID certs which > was resolved, but that won't help until we get an update published. What's > annoying is that the bookmark resolving just crashes rather than handle the > problem gracefully, and we're still not certain whether the incorrect signing > is the real cause or not (the apps were signed, just not using the correct > cert). This deep connection between parts of the OS that behave very > differently according to the situation they find themselves in is a recipe > for very hard-to-find bugs that easily escape QA. Is it possible http://www.mikeabdullah.net/nsurl-bookmark-error-handling.html is biting you? ___ 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: Security-scoped bookmarks linked to code signing?
On 25/10/2012, at 10:05 AM, Mike Abdullah wrote: > > On 24 Oct 2012, at 23:31, Graham Cox wrote: > >> >> On 24/10/2012, at 8:47 PM, Mike Abdullah wrote: >> >>> Handling security-scoped bookmarks most certainly relies upon code-signing, >>> as without you can’t create or resolve them. Are you dealing with app or >>> document scoped bookmarks here? >>> >> >> >> App-scoped. >> >> In dev and testing no problem was encountered but "in the wild" we have this >> crash deep within -[NSURL URLByResolvingBookmarkData:options:.]. The app >> was incorrectly signed due to a stuff-up with the developer ID certs which >> was resolved, but that won't help until we get an update published. What's >> annoying is that the bookmark resolving just crashes rather than handle the >> problem gracefully, and we're still not certain whether the incorrect >> signing is the real cause or not (the apps were signed, just not using the >> correct cert). This deep connection between parts of the OS that behave very >> differently according to the situation they find themselves in is a recipe >> for very hard-to-find bugs that easily escape QA. > > Is it possible http://www.mikeabdullah.net/nsurl-bookmark-error-handling.html > is biting you? > Hmm, interesting... I wasn't setting error to nil, I am now. However, all I do with the value of error is log it if the URL returns nil. While that could crash in the circumstances your post describes, that isn't where it appears to actually be crashing. (Unfortunately I don't have a stack trace handy). Do you know of a way to force this resolution to fail so I can test it? --Graham ___ 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: Cross-fading between layers
I'm surprised it worked at all under any version of OS X, since you set the current layer to the new layer before committing the transition! Since it sees the two layers are the same, there's nothing to change, so nothing happens (I think…) On Oct 18, 2012, at 10:50 AM, Gabriel Zachmann wrote: > About a week ago I have posted about my problem with (not) cross-fading Core > Animation layers in Mountain Lion. > > Perhaps, my post was too long ;-) > Perhaps I forgot to mention that I did google quite bit, but didn't > understand what the best solution would be in my case. > > So far, I am fading out an existing layer, and fading in a new layer by the > following 5 lines of code: > > [CATransaction begin]; > [CATransaction setAnimationDuration: fading_duration]; > [mainLayer_ replaceSublayer: currentLayer_ with: newlayer]; > currentLayer_ = newlayer; > [CATransaction commit]; > > This works fine under Lion, and it worked fine under Snow Leopard. > > It does not work any more under ML, i.e., the layers get replaced, but there > is no cross-dissolve effect. > > Apparently, a number of other people have a similar problem, but the > solutions some of them propose were not clear to me. > > Could some kind soul explain to me how to achieve the cross-dissolve effect > under ML? > > Thanks a lot in advance. > > > Best regards, > Gabriel. > > > ___ > > 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/wsquires%40satx.rr.com > > This email sent to wsqui...@satx.rr.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
Prevent NSSplitView from resizing when replacing sub views
Hello all, I have a view defined in NIB. In my code, I am replacing one subview of a NSSplitView with the NIB view. Unfortunately, NSSplitView resizes its subviews to satisfy the size of the NIB view, which makes the ui jumpy. Is there a way to resize the NIBView to satisfy the NSSplitView instead of the contrary? I am using auto layout so setting the frame of the NIB view directly might not be an option. Thanks! Sent from my iPhone ___ 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