Re: memmove in Swift

2014-08-20 Thread Gerriet M. Denkmann
On 21 Aug 2014, at 11:53, Marco S Hyman wrote: > On Aug 20, 2014, at 8:32 PM, Gerriet M. Denkmann wrote: > >> But I thought that maybe memmove might be more efficient: > > Optimizing already? Not really. More like learning. Actually I was checking the results of Jesse Squires

Re: memmove in Swift

2014-08-20 Thread Roland King
> On 21 Aug 2014, at 12:25 pm, Quincey Morris > wrote: > > On Aug 20, 2014, at 20:32 , Gerriet M. Denkmann wrote: > >> But I thought that maybe memmove might be more efficient: >> >> let dest : UnsafeMutablePointer = arr + lowerIndex + 1 > > Er, no. There are multiple things wrong with thi

Re: memmove in Swift

2014-08-20 Thread Gerriet M. Denkmann
On 21 Aug 2014, at 11:25, Quincey Morris wrote: > On Aug 20, 2014, at 20:32 , Gerriet M. Denkmann wrote: > >> But I thought that maybe memmove might be more efficient: >> >> let dest : UnsafeMutablePointer = arr + lowerIndex + 1 > > Er, no. There are multiple things wrong with this: > > —

Re: memmove in Swift

2014-08-20 Thread Marco S Hyman
On Aug 20, 2014, at 8:32 PM, Gerriet M. Denkmann wrote: > But I thought that maybe memmove might be more efficient: Optimizing already? > > let dest : UnsafeMutablePointer = arr + lowerIndex + 1 arr + lowerIndex + 1 is meaningless to Swift. An [Int32] is not a pointer that can be offset by

Re: memmove in Swift

2014-08-20 Thread Kyle Sluder
On Wed, Aug 20, 2014, at 11:25 PM, Quincey Morris wrote: > — There’s nothing in the Swift array API contract that says that elements > are stored in a contiguous block of memory, or even in several blocks of > memory > > — Even if they were, there’s nothing that says how they’re laid out in > that

Re: Good way to have default relationship to override nil?

2014-08-20 Thread Jerry Krinock
I understand the typos, Jim. So, what is the Inverse Relationship of the ‘proxy’ relationship? I’m guessing it might by “No inverse”? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments t

Re: How can an instance KVO its own and super's attributes, especially with overrides?

2014-08-20 Thread Ken Thomases
On Aug 20, 2014, at 11:02 PM, Daryle Walker wrote: > I’m writing an NSOperation subclass. Instances are dumped into the main > queue, but I hope I stop them from executing right away by overriding > -isReady. But the docs say I have to keep the override KVO-compliant. And my > formula for the

Re: memmove in Swift

2014-08-20 Thread Quincey Morris
On Aug 20, 2014, at 20:32 , Gerriet M. Denkmann wrote: > But I thought that maybe memmove might be more efficient: > > let dest : UnsafeMutablePointer = arr + lowerIndex + 1 Er, no. There are multiple things wrong with this: — There’s nothing in the Swift array API contract that says that ele

How can an instance KVO its own and super's attributes, especially with overrides?

2014-08-20 Thread Daryle Walker
I’m writing an NSOperation subclass. Instances are dumped into the main queue, but I hope I stop them from executing right away by overriding -isReady. But the docs say I have to keep the override KVO-compliant. And my formula for the new -isReady uses the old one. Can I observe on super? Withou

memmove in Swift

2014-08-20 Thread Gerriet M. Denkmann
This works: private func shiftArray( inout arr: [UInt32], lowerIndex: UInt, upperIndex: UInt ) { // move: arr[ lowerIndex ..< upperIndex ] to: arr[ lowerIndex + 1 ... upperIndex ] let av = arr[ Int(upperIndex) ] for v

Re: Good way to have default relationship to override nil?

2014-08-20 Thread Jim Thomason
> > > I have a set of relationships: > > > > Foo.proxy <> Foo.proxyFor > > That’s a head-scratcher, Jim. A relationship is not between properties. > A relationship is between objects, > > Foo <——> Bar > > In some cases, probably yours, the objects may be of the same type… > > Foo <—> Foo > I

Re: Issuing NSTextField action message

2014-08-20 Thread newslists
>> On Aug 20, 2014, at 12:33 PM, Kyle Sluder wrote: > > Bind your text fields' Value binding to various NSNumber properties on > your controller. Turn on Updates Value Continuously for all of these > bindings. Wow, that worked like a charm! The 'Continuously Updates Value' is the key. Very nice.

Re: Good way to have default relationship to override nil?

2014-08-20 Thread Jerry Krinock
> On 2014 Aug 20, at 12:41, Jim Thomason wrote: > > I have a set of relationships: > > Foo.proxy <> Foo.proxyFor That’s a head-scratcher, Jim. A relationship is not between properties. A relationship is between objects, Foo <——> Bar In some cases, probably yours, the objects may be of

Re: AutoLayout textfield against accessory view

2014-08-20 Thread Jonathan Mitchell
On 20 Aug 2014, at 05:26, Luther Baker wrote: > I'd like to place a UITextField in the center of a UITableViewCell such > that initially, the textfield extends to all four sides. > > But ... I'd also like to make it AccessoryView friendly. Namely, when the > accessory appears (or is always appe

Re: Issuing NSTextField action message

2014-08-20 Thread newslists
> On Wed, Aug 20, 2014, at 03:35 PM, Kyle Sluder wrote: >> First, you need to stop using KVO for this. As I said before, >> NSTextField is not documented to be KVO complaint for any of its >> properties, so you cannot observe it. > > To be clear, I interpreted your previous email to mean that you a

Re: Issuing NSTextField action message

2014-08-20 Thread Kyle Sluder
On Wed, Aug 20, 2014, at 03:35 PM, Kyle Sluder wrote: > First, you need to stop using KVO for this. As I said before, > NSTextField is not documented to be KVO complaint for any of its > properties, so you cannot observe it. To be clear, I interpreted your previous email to mean that you are curre

Re: Issuing NSTextField action message

2014-08-20 Thread Kyle Sluder
On Wed, Aug 20, 2014, at 02:35 PM, Carl Hoefs wrote: > > On Aug 20, 2014, at 12:33 PM, Kyle Sluder wrote: > > > On Wed, Aug 20, 2014, at 02:27 PM, Carl Hoefs wrote: > >> I do have -controlTextDidChange: set up, and it does get invoked on every > >> keystroke typed into the textfields, but how do

Good way to have default relationship to override nil?

2014-08-20 Thread Jim Thomason
I have a set of relationships: Foo.proxy <> Foo.proxyFor 1-1 mapping. The way that the data is structured, a Foo object may be a proxy for another one. However, the proxy is not required, in which case the original Foo object should be returned. I'd tried to set this up by creating a custom

Re: Issuing NSTextField action message

2014-08-20 Thread Carl Hoefs
On Aug 20, 2014, at 12:33 PM, Kyle Sluder wrote: > On Wed, Aug 20, 2014, at 02:27 PM, Carl Hoefs wrote: >> I do have -controlTextDidChange: set up, and it does get invoked on every >> keystroke typed into the textfields, but how do I then cause the >> textfield’s action method to be issued? >> -

Re: Issuing NSTextField action message

2014-08-20 Thread Kyle Sluder
On Wed, Aug 20, 2014, at 02:27 PM, Carl Hoefs wrote: > I do have -controlTextDidChange: set up, and it does get invoked on every > keystroke typed into the textfields, but how do I then cause the > textfield’s action method to be issued? > -Carl You don't. You're already getting notified at the ri

Re: Issuing NSTextField action message

2014-08-20 Thread Carl Hoefs
On Aug 20, 2014, at 12:24 PM, Kyle Sluder wrote: >> On Aug 20, 2014, at 11:53 AM, Carl Hoefs >> wrote: >> >> >>> On Aug 20, 2014, at 11:18 AM, Kyle Sluder wrote: >>> On Wed, Aug 20, 2014, at 01:13 PM, Carl Hoefs wrote: I’m working on a financial system that accepts three variable

Re: Issuing NSTextField action message

2014-08-20 Thread Kyle Sluder
> On Aug 20, 2014, at 11:53 AM, Carl Hoefs > wrote: > > >> On Aug 20, 2014, at 11:18 AM, Kyle Sluder wrote: >> >>> On Wed, Aug 20, 2014, at 01:13 PM, Carl Hoefs wrote: >>> I’m working on a financial system that accepts three variable user inputs >>> to a formula. When the user types into any

Re: Issuing NSTextField action message

2014-08-20 Thread Carl Hoefs
On Aug 20, 2014, at 11:18 AM, Kyle Sluder wrote: > On Wed, Aug 20, 2014, at 01:13 PM, Carl Hoefs wrote: >> I’m working on a financial system that accepts three variable user inputs >> to a formula. When the user types into any of the three textfields, it >> must update the other fields as the us

Re: Issuing NSTextField action message

2014-08-20 Thread Kyle Sluder
On Wed, Aug 20, 2014, at 01:13 PM, Carl Hoefs wrote: > I’m working on a financial system that accepts three variable user inputs > to a formula. When the user types into any of the three textfields, it > must update the other fields as the user types, without an Enter or > Return. Think of it like

Re: Issuing NSTextField action message

2014-08-20 Thread Carl Hoefs
On Aug 19, 2014, at 10:38 PM, Ken Thomases wrote: > On Aug 19, 2014, at 8:33 PM, Carl Hoefs > wrote: > >> OS X 10.9.4 I have an NSTextField into which a user types digits. When a >> digit is typed, I have it set up so the -controlTextDidChange: delegate >> method is invoked. Now, in the de

Photo Editing extension needs lots of memory and got crashed. How to avoid it?

2014-08-20 Thread vipgs99
We've developed a Photo Editing extension to edit user's photos. But the photos which user take havelarge high-resolution. When editing them in extension, it will cost about 100-200MB memory and extension get crashed. But we can't reduce user photo's resolution, how to apply more memory in Phot