Re: iPad drawing and screen rotation
On Sep 21, 2012, at 3:18 PM, Donald Hall d...@appsandmore.com wrote: I have a master detail project where I draw Bezier paths in the detail view. On rotation from portrait to landscape (or vice versa) the proportions of the drawings are distorted. For example, a circle in one orientation becomes an oval in the other. What is the best way to maintain the aspect ratio of my drawings through screen rotation? Should I be embedding a second view to take the drawing in the detail view and adjusting the autosizing of this second view to keep it a fixed size? What is the contentMode of your view? The default is (if I recall correctly) UIViewContentModeResize, which will not redraw when the view's bounds changes, but rather stretch the contents to match. -- 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: iOS:targeting iOS3 through iOS6
On Sep 22, 2012, at 6:14 , davel...@mac.com wrote: I think the previous post about needing to use lipo is correct. Xcode 4.5 does not seem to support building for armv6. Ah! That's what I get for not reading the whole thread. Interestingly, I just went through getting armv7 and i386 all together into a .a file for running on the Simulator. The ZBar project has scripts to do it, but honestly, I don't know how it worked. It choked on a missing PListBuddy, which no longer seems to exist, but by that point it had lipoed the library. -- 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: drawGlyphsForGlyphRange layout issue
On 22 Sep 2012, at 01:33, Graham Cox graham@bigpond.com wrote: You might investigate an alternative (and much easier) solution. NSLayoutManager adopts the NSGlyphStorage protocol. That protocol declares a method, -layoutOptions, and one of the flags it can return is NSShowInvisibleGlyphs. Simply returning that flag may be all you need to do. In fact I think this is set for you when you call -setShowsInvisibleCharacters:YES I guess the difference is that it's all or nothing, which might be not the desired result. Works just for space characters, not other whitespace characters. Plus there is no attribute control so it isn't possible to colourise the invisible character glyph as I currently do. Another approach is to override -showCGGlyphs:positions:count:font:matrix:attributes:inContext: which is the primitive drawing method. All of the positioning and context flippedness has been handled by this point, so you can usually just go ahead and draw the characters. Inserting some other glyph at this point for the tab should be straightforward. Good idea. I will investigate this one. However Kyle's idea of modifying the glyph stream may be better. It means that there is no second guessing required when it comes to positioning the substituted glyph. However, I don't know as yet whether I will be able to specify the required font colour. We shall see. Thanks for the advice Graham. Regards Jonathan Mitchell Mugginsoft LLP ___ 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
iCloud timing out
Hey there, I'm have a weird issue with iCloud (iOS). I launched the app and used it with one device, added a bunch of data. Now I try launching the app from other devices (tried 3 so far) and same issue happens: after almost a minute of black screen, the app launches empty and Xcode spills out some nice errors: 2012-09-23 17:42:18.589 TestAppName[531:907] -[PFUbiquitySafeSaveFile waitForFileToUpload:](268): CoreData: Ubiquity: PFUbiquityPeerReceipt: 0x1fd6f710(0) permanentLocation: PFUbiquityLocation: 0x1fd6f560: /private/var/mobile/Library/Mobile Documents/L4SHG85TPB~leaving-earth~TestAppName/iCloudData/mobile.8EB026E8-0B9C-520C-AEA7-87338C2EA6D5/iCloudStore/pzDifSoLqJrhe1OpWbDm2__vXwzNdG7q02coJPR0PJM=/receipt.0.cdt safeLocation: PFUbiquityLocation: 0x1fd6f240: /private/var/mobile/Library/Mobile Documents/L4SHG85TPB~leaving-earth~TestAppName/iCloudData/mobile.8EB026E8-0B9C-520C-AEA7-87338C2EA6D5/iCloudStore/pzDifSoLqJrhe1OpWbDm2__vXwzNdG7q02coJPR0PJM=/mobile.8EB026E8-0B9C-520C-AEA7-87338C2EA6D5.0.cdt currentLocation: PFUbiquityLocation: 0x1fd6f240: /private/var/mobile/Library/Mobile Documents/L4SHG85TPB~leaving-earth~TestAppName/iCloudData/mobile.8EB026E8-0B9C-520C-AEA7-87338C2EA6D5/iCloudStore/pzDifSoLqJrhe1OpWbDm2__vXwzNdG7q02coJPR0PJM=/mobile.8EB026E8-0B9C-520C-AEA7-87338C2EA6D5.0.cdt kv: (null) Safe save failed for file, error: Error Domain=NSCocoaErrorDomain Code=512 The file upload timed out. UserInfo=0x1fd70c80 {NSLocalizedDescription=The file upload timed out.} 2012-09-23 17:42:18.593 TestAppName[531:907] Unable to add iCloud store: Error Domain=NSCocoaErrorDomain Code=512 The file upload timed out. UserInfo=0x1fd70c80 {NSLocalizedDescription=The file upload timed out.} No idea why. It works with the first device I installed just fine. With any other device, I get this. Any ideas? Thanks, Elland ___ 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: drawGlyphsForGlyphRange layout issue
On Sun, Sep 23, 2012, at 01:55 AM, jonat...@mugginsoft.com wrote: On 22 Sep 2012, at 01:33, Graham Cox graham@bigpond.com wrote: You might investigate an alternative (and much easier) solution. NSLayoutManager adopts the NSGlyphStorage protocol. That protocol declares a method, -layoutOptions, and one of the flags it can return is NSShowInvisibleGlyphs. Simply returning that flag may be all you need to do. In fact I think this is set for you when you call -setShowsInvisibleCharacters:YES I guess the difference is that it's all or nothing, which might be not the desired result. Works just for space characters, not other whitespace characters. Plus there is no attribute control so it isn't possible to colourise the invisible character glyph as I currently do. Another approach is to override -showCGGlyphs:positions:count:font:matrix:attributes:inContext: which is the primitive drawing method. All of the positioning and context flippedness has been handled by this point, so you can usually just go ahead and draw the characters. Inserting some other glyph at this point for the tab should be straightforward. Good idea. I will investigate this one. However Kyle's idea of modifying the glyph stream may be better. It means that there is no second guessing required when it comes to positioning the substituted glyph. However, I don't know as yet whether I will be able to specify the required font colour. We shall see. Attributes are specified on a character, rather than glyph, basis. So if you need to draw your characters with a separate color, you should probably override -showCGGlyphs:positions:count:font:matrix:attributes:inContext: to push and pop the foreground color you want before calling super. Should be a really simple override, because the context is already set up for you. --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: autosavesInPlace and sandbox
Hi Sorry for not answering earlier. I was to busy with other things. Am 07.09.2012 um 15:36 schrieb Mike Abdullah: On 6 Sep 2012, at 23:27, Georg Seifert georg.seif...@gmx.de wrote: On 06.09.2012, at 15:32, Mike Abdullah wrote: On 6 Sep 2012, at 13:36, Georg Seifert georg.seif...@gmx.de wrote: Hi, I have a problem. My app (documents based) does not support Lions Version (returns NO in autosavesInPlace). This worked fine until I had to sandbox my app. The problem is, that now the NSDocument autosaving tries to create a file called My Document Name (Autosaved).myExtension next to the document. But this is blocked by the sandbox. Is there any way to extend the permission to the autosave file or can I force NSDocument to always store the autosave files in the container? What's stopping you adopting autosave-in-place? I actually used autosave in place but my users did not like it at all. If you have to open a lot files all the time just to check something, you do not like that any mouse click might change your document and you are not asked if you what to keep it. So let's try to nail down some of the real problems here: NSDocument's old autosave support periodically saves a copy of the document as the user works. For new, unsaved documents, that's not a problem with the sandbox. For existing documents it is though, because gets saved alongside the original. The logic is that should the program crash or similar, and the user is unable to re-open it in a normal fashion, that autosaved copy of the doc is still sitting there on the filesystem in plain sight. The user can just go and open it up and play with it. If you're absolutely desperate to keep using the old autosave system, it might be possible to use 10.8's extra entitlements to declare that you need write access to a specific filename alongside an existing one. But it's 10.8 only and I don't know if it could quite meet your needs. Another alternative would be to ask the system to autosave to an alternative location which you do have write access to. Your users lose the ability to easily spot the autosaved copy of the doc, but otherwise it should perform fine. Can someone give me a hint on how to do that? That said, I would strongly encourage you to adopt autosave-in-place. You describe the problem in two parts: you do not like that any mouse click might change your document Surely this applies to either saving system? No, with the new style autosaving, the file changes on disk without asking the user. you are not asked if you want to keep it So here's the real problem it seems; you run into customers accidentally modifying documents. Normally they would be warned as they quit or close the doc, but with autosave-in-place, that doesn't happen. Some good news in 10.8: users can turn on a system preference so that they get effectively get back the warning behaviour. Closing a document will warn you if there are unsaved changes. However, the file on disk will already have been updated. That might bother them; I don't know. But more importantly, isn't this exactly what 10.7's concept of locked documents tried to solve? If the doc hadn't been edited in a while, it would be marked as locked. So the first time any edit occurred, a sheet popped down asking if the user wanted to go ahead with the edit, duplicate the doc or cancel. Was that not kicking in for your typical customers? Perhaps because the document was too recently edited? 10.8 does throw this out of the window. But what you could do is override -checkAutosavingSafetyAndReturnError: so that it always returns NO when a doc is first opened. If your app is primarily used as a viewer, that could be a neat way for you to always ask if the first edit is intended. Thanks Georg ___ 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
Usability of a Movie View
Dear list, I am developing an application for playing videos, whose one of the main functions is zooming the video to let the user observe the details if the video frame size is large (it will be used to play the videos recorded by the dash camera). I have created a 'prototype' of a video view that allows to perform this (the video is being zoomed with a scroll wheel, and zooming occurs where the mouse cursor is - i am setting the anchor point in that place), along with panning the video frame (the frame can be dragged) - mainly using core animation. What I am asking here: I am not sure how usable such a control is. The main problem (as for me) is that the user can drag the video frame out of sight. He can zoom the video the way it moves out of sight. When the window is being zoomed, the frame doesn't get zoomed up till the moment the user ends zooming (because I am resetting the video layer size to the view size in -viewDidEndLiveResize. I don't know how to make the video layer resize together with the view - I tried to do this in -drawRect, checking the isBeingResized flag, but doing so kills all the animation - if you try to resize the view you can see that the Zoom label moves with animation, but the video frame wouldn't do so..). Could you please give some advices how to make the control more usable and solve these problems? I do not post the source code, it is a bit bulky for the list, although I may post it here if needed.. The test application can be found here: http://rghost.net/40542098 Thank you! Nick ___ 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: Toddler-proofing an app (disabling spotlight keyboard shortcut)?
Thank you, Ken. Your tips pointed me in an acceptable direction. I poked around in the cocos2d internals and discovered that your second option worked best. The Kiosk Mode Technical Note was helpful: http://developer.apple.com/library/mac/#technotes/KioskMode/Introduction/Introduction.html This is the code that did it for me: NSApplicationPresentationOptions options = NSApplicationPresentationHideDock + NSApplicationPresentationDisableProcessSwitching; NSNumber *presentationOptions = [NSNumber numberWithUnsignedLong:options]; NSArray *keys = [NSArray arrayWithObjects:@NSFullScreenModeAllScreens, @NSFullScreenModeApplicationPresentationOptions, nil]; NSArray *values = [NSArray arrayWithObjects:[NSNumber numberWithBool:YES], presentationOptions, nil]; NSDictionary *fullScreenOptions = [[NSDictionary alloc] initWithObjects:values forKeys:keys]; [glView_ enterFullScreenMode:[NSScreen mainScreen] withOptions:fullScreenOptions]; I'll let my daughter bang on it tomorrow and we'll see what other sorts of secret key commands she discovers! Cheers, Clay On Sep 22, 2012, at 2:59 AM, Ken Thomases k...@codeweavers.com wrote: If your app is full-screen, you might capture the display. See the Quartz Display Services https://developer.apple.com/library/mac/#documentation/graphicsimaging/Conceptual/QuartzDisplayServicesConceptual/Articles/DisplayCapture.html. Capturing the display prevents Command-Tab app switching, Exposé/Mission Control, Spotlight, etc. I believe it will also prevent system keyboard shortcuts (e.g. hiding the Dock with Command-Option-D) from reaching the wider system. It might also work to set the application presentation options. -[NSApplication setPresentationOptions:] with options including NSApplicationPresentationDisableAppleMenu and NSApplicationPresentationDisableProcessSwitching. Or those options can be included with the options passed to -[NSView enterFullScreenMode:withOptions:] under the NSFullScreenModeApplicationPresentationOptions key. Finally, you can use a custom subclass of NSApplication, override -sendEvent:, detect events which correspond to hot keys, and don't pass them through to super. Detecting hot keys is kind of hard. There's CopySymbolicHotKeys(), but it can be hard to interpret the output data and it's probably also not available in 64-bit. For a private-use-only app, you can get away with hard-coding keys that actually cause you trouble. Cheers, Ken ___ 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
iOS encrypt and stream local video file
I have an ios app that contains video files. I'm concerned about users with jailbroken phones being able to rip these videos out of the app. One of the solutions I thought might work would be to encrypt the videos, then from a http server running from within the app, segment and serve the files, and then decrypt them to MPMovieController via the http live streaming protocol. Is this something that can be done(and also be approved by the app store)? Perhaps there is a component out there that does this already even? Perhaps I'm too worried about jailbreakers sneaking into my content? ___ 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: iOS encrypt and stream local video file
You're too worried about jailbreakers sneaking into your content. :) Yes you can probably do something like what you suggest if you're pretty good with encryption, and encryption on iOS is more limited than on OSX. But it's going to be a mass load of work and you will still have to have the decryption key in your app somewhere anyway so anyone determined enough is going to be able to figure out what you did and decrypt them anyway. As for approval, nobody can speak for the appstore reviewers. You will probably have to fill out the 'uses encryption' form and that leads to loads of export questions, which may be another problem you don't want to give yourself. I tend to find most people suggest that anything beyond a bit of security by obscurity is more work than it's worth. On 24 Sep, 2012, at 10:07 AM, Michael Hanna taomaili...@gmail.com wrote: I have an ios app that contains video files. I'm concerned about users with jailbroken phones being able to rip these videos out of the app. One of the solutions I thought might work would be to encrypt the videos, then from a http server running from within the app, segment and serve the files, and then decrypt them to MPMovieController via the http live streaming protocol. Is this something that can be done(and also be approved by the app store)? Perhaps there is a component out there that does this already even? Perhaps I'm too worried about jailbreakers sneaking into my content? ___ ___ 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: iOS encrypt and stream local video file
On Sun, Sep 23, 2012, at 07:07 PM, Michael Hanna wrote: I have an ios app that contains video files. I'm concerned about users with jailbroken phones being able to rip these videos out of the app. You don't need to jailbreak your phone to get at the resources of an app; the .ipa itself is not encrypted. --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