Re: Asynchronously mounting a remote file server?

2013-06-14 Thread Mike Abdullah
On 14 Jun 2013, at 06:40, Jens Alfke wrote: > > On Jun 13, 2013, at 2:17 PM, Rick Mann wrote: > >> I'd like to be smarter about this in my own apps. Is there a test I can >> perform before accessing aliases I've stored, or an async way to open/read >> from files that won't block the main th

Re: -[NSManagedObjectContext performBlock:] concurrent or serial?

2013-06-14 Thread Mike Abdullah
On 14 Jun 2013, at 00:03, davel...@mac.com wrote: > > On May 31, 2013, at 7:40 PM, Rick Mann wrote: > >> Hi. If I issue a bunch of -performBlock: calls on a particular Managed >> Object Context, will they execute serially or concurrently? >> >> Thanks, >> >> -- >> Rick > > I'm assuming se

Re: Isolated process for each NSDocument of my app

2013-06-14 Thread Daniele Margutti
On 14 Jun 2013, at 03:00, Graham Cox wrote: > No offence, but when a programmer says this, all they're doing is revealing > their own inexperience. I mean that in a friendly way; I've been there many > times myself. > > There *is* a way, you just have to figure it out (or ask someone to help

Re: Isolated process for each NSDocument of my app

2013-06-14 Thread Kyle Sluder
On Jun 14, 2013, at 1:15 AM, Daniele Margutti wrote: > > No offence guy, but seriusly I can’t. We have a compatible UIKit layer which > can run on OS X. In order to mantain compatibility I need to handle > UIApplication and UIScreen singleton; morehower I need to manage > UIAppearance. This t

Re: Isolated process for each NSDocument of my app

2013-06-14 Thread Alex Zavatone
The model you are mentioning seems a lot like multiple users accessing a database on a remote server. In this analogy, the database is your document. The users accessing that one database are the other apps that are accessing it. On Jun 13, 2013, at 2:29 PM, Daniele Margutti wrote: > > On

Re: Asynchronously mounting a remote file server?

2013-06-14 Thread Jens Alfke
On Jun 14, 2013, at 12:22 AM, Mike Abdullah wrote: > There's no async API. I filed a radar asking for this relatively recently and > was recommended to shove such tasks onto the low priority GCD queue instead. That sounds reasonable, as long as that function is safe to call on a background th

Re: Asynchronously mounting a remote file server?

2013-06-14 Thread Mike Abdullah
On 14 Jun 2013, at 18:06, Jens Alfke wrote: > > On Jun 14, 2013, at 12:22 AM, Mike Abdullah wrote: > >> There's no async API. I filed a radar asking for this relatively recently >> and was recommended to shove such tasks onto the low priority GCD queue >> instead. > > That sounds reasonabl

Re: Isolated process for each NSDocument of my app

2013-06-14 Thread Jens Alfke
On Jun 14, 2013, at 1:15 AM, Daniele Margutti wrote: > No offence guy, but seriusly I can’t. We have a compatible UIKit layer which > can run on OS X. In order to mantain compatibility I need to handle > UIApplication and UIScreen singleton; morehower I need to manage > UIAppearance. This thi

Re: Isolated process for each NSDocument of my app

2013-06-14 Thread Scott Ribe
On Jun 14, 2013, at 11:17 AM, Jens Alfke wrote: > This also avoids trouble with thread-safety because it ensures that only one > of those app UI threads can be handling UI events at a time. But isn't it still true that many UI-oriented APIs can only be safely called on the main thread, regardle

Multiple Observations

2013-06-14 Thread Gordon Apple
- (void)awakeFromNib { [self.doc addObserver:self forKeyPath:@"currentPath" options:NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld context:nil]; } - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(

Re: Multiple Observations

2013-06-14 Thread Quincey Morris
On Jun 14, 2013, at 13:06 , Gordon Apple wrote: > ³currentPath² property in doc gets set once. Observation gets dinged about > 200 times. Removing the ³reloadData² didn¹t affect this. Same observer in > another file gets dinged once, like it should. Stack trace always leads > back to where "c

Re: Multiple Observations

2013-06-14 Thread Lee Ann Rucker
On Jun 14, 2013, at 1:06 PM, Gordon Apple wrote: > - (void)awakeFromNib { >[self.doc addObserver:self > forKeyPath:@"currentPath" > options:NSKeyValueObservingOptionNew | > NSKeyValueObservingOptionOld > context:nil]; > } > > - (void)observeVal

Keeping UIScrollView content centered

2013-06-14 Thread Rick Mann
As I'm experimenting with how to implement pinch and rotate gestures in a UIScrolLView, I set up a non-autolayout (traditional) pinch-zooming UIScrollView with a UIImageView inside it. I followed the instructions here: http://developer.apple.com/library/ios/#documentation/windowsviews/conceptua

Re: assertion failure from NSScrollView

2013-06-14 Thread James Walker
On 6/12/2013 6:51 PM, James Walker wrote: In Lion 10.7.4, if the General preference pane has set "Show scroll bars" to "Automatically based on input device", then when my window appears I see the following mess in the log. The other two preference alternatives don't cause this. Any idea what's

Re: Isolated process for each NSDocument of my app

2013-06-14 Thread Graham Cox
On 14/06/2013, at 6:15 PM, Daniele Margutti wrote: > No offence guy, but seriusly I can’t. We have a compatible UIKit layer which > can run on OS X. In order to mantain compatibility I need to handle > UIApplication and UIScreen singleton; morehower I need to manage > UIAppearance. This thing

Combining pan, zoom, and rotate gestures into one?

2013-06-14 Thread Rick Mann
The Apple Maps application allows you to pan, zoom, and rotate in a single two-finger gesture. Is that done with three gesture recognizers all operating simultaneously? Or are they just handling the touches directly? I don't see how to get a combined transform out of the three separate gesture

Re: Combining pan, zoom, and rotate gestures into one?

2013-06-14 Thread David Rowland
Isn't it a matter of implementing this delegate method? - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer { return YES; } David On Jun 14, 2013, at 5:41 PM, Rick Mann wr

Re: Combining pan, zoom, and rotate gestures into one?

2013-06-14 Thread Rick Mann
On Jun 14, 2013, at 18:09 , David Rowland wrote: > Isn't it a matter of implementing this delegate method? > > - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer > shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer > *)otherGestureRecognizer > { > retu

Re: Combining pan, zoom, and rotate gestures into one?

2013-06-14 Thread Rick Mann
So, this sort of works, and fails spectacularly. The problem is that I can't specify the order in which each gesture's values are applied to the view's transform. So, I end up with a side-to-side panning gesture making the image move up-and-down when it's rotated about 90°. On Jun 14, 2013, a

Re: Combining pan, zoom, and rotate gestures into one?

2013-06-14 Thread Jonathan Hull
Assuming you want to rotate about the center of the object, you probably want to translate the object so it's center is at the origin, do the rotation, and then do the inverse of the translation. If you do that, the order of the recognizers shouldn't matter. Thanks, Jon On Jun 14, 2013, at 7

First Responder on iOS

2013-06-14 Thread Graham Cox
Developing a simple iOS app, I've run into a little misunderstanding about First Responder. On the Mac, the app's delegate gets messages intended for FR that reach NSApplication, on iOS, that appears not to be the case. My app needs a simple action method that can be accessed from two different