Re: Asynchronously mounting a remote file server?

2013-06-14 Thread Mike Abdullah

On 14 Jun 2013, at 06:40, Jens Alfke j...@mooseyard.com wrote:

 
 On Jun 13, 2013, at 2:17 PM, Rick Mann rm...@latencyzero.com 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 thread?
 
 It’s not opening or reading from the file that’s the slow part, it’s 
 resolving the alias, which happens first. (Aliases aren’t automatic or 
 transparent like symlinks; something has to explicitly recognize a file as an 
 alias and then resolve it to get the destination file’s location.)
 
 I know the alias APIs have changed in the last few years, and I don’t know 
 the new ones, but I’d imagine there is an async variant. Once you’ve resolved 
 the alias, you can open/read from the file as normal. If you think the actual 
 file I/O might still be too slow, you can do it on a background thread.

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.


___

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: -[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 rm...@latencyzero.com 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 serially and I would like to know too so I was hoping someone 
 would provide a definitive answer. Did I miss it or did nobody respond to 
 this?

Core Data guarantees that the tasks *won't* be executed in parallel. I can find 
no documented guarantee that they'll be performed in the *same order* as they 
were *enqueued* though. But, in practice MOCs implement their queue internally 
using a GCD serial queue, so you'll get the same serialization behaviour as 
that.
___

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: Isolated process for each NSDocument of my app

2013-06-14 Thread Daniele Margutti

On 14 Jun 2013, at 03:00, Graham Cox graham@bigpond.com 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 you 
 figure it out).

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 can’t work on with multiple projects at the same time so in order to 
work with it I need to isolate each project/UIKit instance/process from the 
other.
___

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: Isolated process for each NSDocument of my app

2013-06-14 Thread Kyle Sluder
On Jun 14, 2013, at 1:15 AM, Daniele Margutti m...@danielemargutti.com 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 can’t work on with multiple projects at the same 
 time so in order to work with it I need to isolate each project/UIKit 
 instance/process from the other.

So your response to a problem entirely of your own making is to try to whip a 
system framework into doing something it is very much not designed to do.

Step back and take a deep breath. You need to remove your blinders and 
rationally analyze your options.

AppKit simply does not and will not work the way you want it to. You can't just 
split code into subprocesses when that code might be sharing untold amounts of 
state and memory. It would be *astronomically* more difficult to accomplish 
this than it would be to 1) either fix your UIKit clone or 2) just stop 
treating the Mac as a second-class citizen and use AppKit natively for your UI. 
Both of those are under your control; the code within AppKit is not.

--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: 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 13 Jun 2013, at 20:05, Tom Davie tom.da...@gmail.com wrote:
 
 The best way is to write an application that's stable.  The only reason 
 browsers started doing this was because they had to deal with 3rd party code 
 (e.g. flash) that was giving them a terrible reputation for instability.  If 
 you're controlling the entire app, you have no reasonable reason to do this. 
  Simply fix your crasher bugs instead.
 
 Overall stability is not my reason to evaluate this kind of a architecture; 
 for a particular reason each document should interact with an external 
 singleton class but each singleton must be unique around the app; think about 
 UIApplication on iOS; I need to work with a similar thing so I need to “run” 
 multiple projects and each one must see a single instance of this object. I 
 cannot change this kind for several reason, so an architecture like this 
 could be a great answer to enable multiple documents support in my 
 application.
 ___
 
 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/zav%40mac.com
 
 This email sent to z...@mac.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: Asynchronously mounting a remote file server?

2013-06-14 Thread Jens Alfke

On Jun 14, 2013, at 12:22 AM, Mike Abdullah mabdul...@karelia.com 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 thread of course. (I wasn't sure, since it may require user 
interaction such as getting credentials for a file server, or that “Do you want 
to locate the file?” alert.)

—Jens
___

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: Asynchronously mounting a remote file server?

2013-06-14 Thread Mike Abdullah

On 14 Jun 2013, at 18:06, Jens Alfke j...@mooseyard.com wrote:

 
 On Jun 14, 2013, at 12:22 AM, Mike Abdullah mabdul...@karelia.com 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 thread of course. (I wasn't sure, since it may require user 
 interaction such as getting credentials for a file server, or that “Do you 
 want to locate the file?” alert.)

My understanding is the bookmarks API is completely threadsafe. Any UI that 
appears as a result is actually handled outside of the calling process.

___

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: Isolated process for each NSDocument of my app

2013-06-14 Thread Jens Alfke

On Jun 14, 2013, at 1:15 AM, Daniele Margutti m...@danielemargutti.com 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 can’t work on with multiple projects at the same 
 time so in order to work with it I need to isolate each project/UIKit 
 instance/process from the other.

I’m going to ignore the issue of whether it even makes sense to try to bash 
code and UI designed for iOS into running on Mac OS. Apps that are ported 
across platforms by brute force this way rarely work well.

At a technical level, I think your best bet is to use state-switching. Use a 
model where one app instance is active at a time. Each one has its own 
instances of the singletons (UIApplication, etc.) and when an app instance is 
active, the singleton accessors like [UIApplication application] return the 
object matching that app instance.

Now you have only one piece of global state, the current-app-instance. What you 
need to do is switch that appropriately based on which app is going to be 
running next. The obvious thing is before handing an event, determine which app 
it’s aimed at (probably based on which app owns the appropriate NSWindow) and 
set that one.

The harder task is to set the current-app when other runloop-based calls 
happen, like timers and delayed-performs and NSURLConnection delegate calls and 
so forth. Wrapping all of those APIs would be a real pain.

One possible solution is to create a new thread with its own runloop for each 
app instance, and always run it on that thread. Then in fact you can resolve 
all your singletons by using the NSThread dictionary to look up state. You just 
have to handle events by looking up the target app’s thread, posting the event 
to that thread’s runloop, and then blocking till it completes. (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.)

This still sounds challenging, but it’ll be a million times easier than trying 
to run multiple processes.

—Jens
___

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: 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, regardless of anything you may do to prevent more than one 
thread at a time running the UI?

-- 
Scott Ribe
scott_r...@elevated-dev.com
http://www.elevated-dev.com/
(303) 722-0567 voice





___

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


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:(id)object
change:(NSDictionary *)change
   context:(void *)context  {

if (object == self.doc  [keyPath isEqualToString:@currentPath] 
self.outlineView != nil) {
[self.outlineView reloadData];

//Debugging
static NSUInteger dingCount = 0;
dingCount++;
NSLog(@dingCount = %lu, dingCount);
}
}

³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 currentPath is set in doc.  Any theories on what could cause
this observer to have diarrhea?
___

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: Multiple Observations

2013-06-14 Thread Quincey Morris
On Jun 14, 2013, at 13:06 , Gordon Apple g...@ed4u.com 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 currentPath is set in doc.  Any theories on what could cause
 this observer to have diarrhea?

If the stack trace indicates that the observation is triggered by the 
currentPath setter, then you're looking for your bug in the wrong place. The 
problem is (prima facie) that the setter is being invoked multiple times. The 
cause is further up the call stack.

BTW, I hope your real code isn't (a) using a nil context and (b) failing the 
check the context in the observation method.

___

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: 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)observeValueForKeyPath:(NSString *)keyPath
  ofObject:(id)object
change:(NSDictionary *)change
   context:(void *)context  {
 
if (object == self.doc  [keyPath isEqualToString:@currentPath] 
 self.outlineView != nil) {
[self.outlineView reloadData];
 
//Debugging
static NSUInteger dingCount = 0;
dingCount++;
NSLog(@dingCount = %lu, dingCount);
}
 }
 
 ³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 currentPath is set in doc.  Any theories on what could cause
 this observer to have diarrhea?

If it's not multiple calls to the setter, could it be multiple calls to 
awakeFromNib? What does the observationInfo on self.doc look like?
___

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

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/conceptual/UIScrollView_pg/ZoomZoom/ZoomZoom.html

And looked at the TapToZoom example. This mostly works, but if I zoom way out, 
so that my image (which has an aspect ratio that doesn't match the screen) is 
completely visible, it's not centered in the view; it's pinned to the 
upper-left.

The Photos app seems to nicely keep the image centered. What's the right way to 
do this?


-- 
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: 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 going on?  (The input
device is a mouse, by the way.)


Never mind, I found the problem.  It was code equivalent to

[[NSScrollView new] initWithFrame: someRect]

thus initializing the object twice.

--
  James W. Walker, Innoventive Software LLC
  http://www.frameforge3d.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: Isolated process for each NSDocument of my app

2013-06-14 Thread Graham Cox

On 14/06/2013, at 6:15 PM, Daniele Margutti m...@danielemargutti.com 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 can’t work on with multiple projects at the same 
 time so in order to work with it I need to isolate each project/UIKit 
 instance/process from the other.


That's exactly the sort of thing I'm referring to - for whatever reason your 
design is incorrect, so you're now trying to fix that by adding more 
incorrectness.

The split between your controller and view layer is in the wrong place. By 
refactoring you can replace your view layer by a native OSX one and not attempt 
to add a layer ON TOP of your view layer to make Mac OSX look like UIKit.

While I haven't had much experience on iOS yet, I have made a few simple apps 
that work across iOS and Mac OS and by and large these share 70% or more of the 
controller and model code. Most of the view stuff comes from xibs and so in 
reality there isn't that much code that differs. I would accept that your app 
is a lot more complicated than mine, but nevertheless the right approach should 
make cross-platform deployment reasonably straightforward. It's much easier 
than, say, Windows/Mac cross-platform, at least the whole thing can be in Cocoa.

--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

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 
recognizers.

-- 
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: 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 rm...@latencyzero.com wrote:

 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 
 recognizers.
 
 -- 
 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/rowlandd%40sbcglobal.net
 
 This email sent to rowla...@sbcglobal.net

___

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: Combining pan, zoom, and rotate gestures into one?

2013-06-14 Thread Rick Mann

On Jun 14, 2013, at 18:09 , David Rowland rowla...@sbcglobal.net wrote:

 Isn't it a matter of implementing this delegate method?
 
 - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer 
 shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer 
 *)otherGestureRecognizer
 {
 return YES;
 }

I was thinking that was insufficient, because to rotate properly, you need a 
point about which to rotate. The rotation gesture by itself doesn't give you 
that (it only provides a rotation).

Actually, I'm wrong about that. All gestures give a location value. But none of 
the examples I saw rotated about that location.

I'll have to continue experimenting.


-- 
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: 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, at 18:09 , David Rowland rowla...@sbcglobal.net wrote:

 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 rm...@latencyzero.com wrote:
 
 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 recognizers.
 
 -- 
 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/rowlandd%40sbcglobal.net
 
 This email sent to rowla...@sbcglobal.net
 


-- 
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: 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:26 PM, Rick Mann rm...@latencyzero.com wrote:

 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, at 18:09 , David Rowland rowla...@sbcglobal.net wrote:
 
 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 rm...@latencyzero.com wrote:
 
 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 recognizers.
 
 -- 
 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/rowlandd%40sbcglobal.net
 
 This email sent to rowla...@sbcglobal.net
 
 
 
 -- 
 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/jhull%40gbis.com
 
 This email sent to jh...@gbis.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