selectText of NSTextField on focus

2015-07-06 Thread Richard Charles
I have a NSTextField subclass that selects all of the text when the user clicks it. This is accomplished by overriding becomeFirstResponder. - (BOOL)becomeFirstResponder { BOOL result = [super becomeFirstResponder]; if(result) { [self performSelector:@selector(selectText:) withObj

Re: selectText of NSTextField on focus

2015-07-06 Thread Richard Charles
> On Jul 6, 2015, at 10:15 AM, Richard Charles wrote: > > I have a NSTextField subclass that selects all of the text when the user > clicks it. This is accomplished by overriding becomeFirstResponder. > > - (BOOL)becomeFirstResponder > { >BOOL result = [super becomeFirstResponder]; >if

Re: selectText of NSTextField on focus

2015-07-06 Thread Quincey Morris
On Jul 6, 2015, at 10:54 , Richard Charles wrote: >[self performSelector:@selector(selectText:) withObject:self > afterDelay:0]; I dunno, but I suspect that this isn’t good enough. You’re merely guessing that “on the next iteration of the run loop” is *after* the text field finished b

Re: selectText of NSTextField on focus

2015-07-06 Thread Gary L. Wade
You want to select the text using the associated text view of the NSTextField control. -- Gary L. Wade (Sent from my iPhone) http://www.garywade.com/ > On Jul 6, 2015, at 10:54 AM, Richard Charles wrote: > > >> On Jul 6, 2015, at 10:15 AM, Richard Charles wrote: >> >> I have a NSTextField su

Errors resulting from Cocoa datatype changes 10.9 -> 10.10

2015-07-06 Thread Carl Hoefs
We have a legacy Cocoa library of mathematical algorithms that has worked fine since OS X 10.6, but running this same code on 10.10 results in odd numerical errors (that is, incorrect results). I'm thinking this could be the result of differences in ILP32 vs LP64? The code variables are ints and p

Re: selectText of NSTextField on focus

2015-07-06 Thread Richard Charles
> On Jul 6, 2015, at 12:12 PM, Gary L. Wade wrote: > > You want to select the text using the associated text view of the NSTextField > control. Not sure what you mean by the "associated text view" of the control. Do you mean the field editor of the control? I have subclassed NSTextField and ov

Re: selectText of NSTextField on focus

2015-07-06 Thread Mike Abdullah
> On 6 Jul 2015, at 20:38, Richard Charles wrote: > >> On Jul 6, 2015, at 12:12 PM, Gary L. Wade wrote: >> >> You want to select the text using the associated text view of the >> NSTextField control. > > Not sure what you mean by the "associated text view" of the control. Do you > mean the f

Swift Enums and CoreData

2015-07-06 Thread Rick Aurbach
I have an object class which maps to a CoreData object. Each instance of this object contains a one-to-many relationship to a set of subsidiary objects, each of which describes an event. That is, each main object has an array of events. Now there are a number of different event types (around a h

Re: Errors resulting from Cocoa datatype changes 10.9 -> 10.10

2015-07-06 Thread Thomas Wetmore
Carl, There is nothing wrong with the code. It is good C code from the good ole days. Size of pointers has no effect, other than in the total sizes of the arrays being allocated. Similar for the size of ints themselves. However, you stop short in your example, and you don’t show either how you

Re: selectText of NSTextField on focus

2015-07-06 Thread Quincey Morris
On Jul 6, 2015, at 12:38 , Richard Charles wrote: > > The delegate methods textDidBeginEditing: and controlTextDidBeginEditing: are > not called when clicking into the view. They are called when the first edit > is actually attempted. So that did not work. My only other suggestion is that the

Re: selectText of NSTextField on focus

2015-07-06 Thread Quincey Morris
On Jul 6, 2015, at 09:15 , Richard Charles wrote: > > I have a NSTextField subclass that selects all of the text when the user > clicks it. Incidentally — this is the part where we make you sorry you asked the question — what are you trying to achieve here? Auto-self-selecting text fields are

Re: Swift Enums and CoreData

2015-07-06 Thread Quincey Morris
On Jul 6, 2015, at 13:10 , Rick Aurbach wrote: > > So my question: does this make any sense? If I was going to Swift-ify the Event concept, I wouldn’t use an enum *inside* an Event object, I’d use an enum (with associated values) *instead of* an Event object. In the context of Core Data, this

Re: Swift Enums and CoreData

2015-07-06 Thread Rick Aurbach
On Jul 6, 2015, at 5:15 PM, Quincey Morris mailto:quinceymor...@rivergatesoftware.com>> wrote: On Jul 6, 2015, at 13:10 , Rick Aurbach mailto:r...@aurbach.com>> wrote: So my question: does this make any sense? If I was going to Swift-ify the Event concept, I wouldn’t use an enum *inside* an

Re: selectText of NSTextField on focus

2015-07-06 Thread Richard Charles
> On Jul 6, 2015, at 4:09 PM, Quincey Morris wrote: > > Incidentally — this is the part where we make you sorry you asked the > question — what are you trying to achieve here? Auto-self-selecting text > fields are an incredibly annoying UI, if the user is ever likely to want to > select only p

Re: Swift Enums and CoreData

2015-07-06 Thread Quincey Morris
On Jul 6, 2015, at 16:21 , Rick Aurbach wrote: > > Are you suggesting that we implement a custom fetched property No, I’m thinking of this: https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/CoreData/Articles/cdNSAttributes.html#//apple_ref/doc/uid/TP40001919-SW13

Re: selectText of NSTextField on focus

2015-07-06 Thread Quincey Morris
On Jul 6, 2015, at 16:16 , Richard Charles wrote: > > Finder does something similar when renaming files and folders. The first > click selects the file or folder. The next click selects the name of the file > or folder ready for replacement. The third click will place the insertion > point som

Re: selectText of NSTextField on focus

2015-07-06 Thread Joel Norvell
Hi Richard, When the instance of your NSTextField subclass becomes first responder, you have access to the NSText object (the field editor) and I believe you can use its methods to select the text. (I don't see why you can't, but since I haven't tried it myself, I'm saying "I believe.") Sincere

Unable to connect IBOutlet in Swift Xcode 7b2

2015-07-06 Thread Rick Mann
I'm having a heck of a time connecting UIViews to my classes. I have a UICollectionViewCell subclass with a bunch of subviews. One of those is custom. While I can drag from views to the Swift code for the UICollectionViewCell subclass, it keeps trying to connect it to a storyboard in a completel

Re: Unable to connect IBOutlet in Swift Xcode 7b2

2015-07-06 Thread Charles Srstka
On Jul 6, 2015, at 7:46 PM, Rick Mann wrote: > > I'm having a heck of a time connecting UIViews to my classes. I have a > UICollectionViewCell subclass with a bunch of subviews. One of those is > custom. > > While I can drag from views to the Swift code for the UICollectionViewCell > subclass

Re: Unable to connect IBOutlet in Swift Xcode 7b2

2015-07-06 Thread Rick Mann
> On Jul 6, 2015, at 17:54 , Charles Srstka wrote: > > I’ve occasionally had issues getting Xcode to connect outlets and actions. My > workaround for it is to open the Assistant view, and drag from your view into > the source file, and let Xcode create an outlet or action automatically. Then

Re: Unable to connect IBOutlet in Swift Xcode 7b2

2015-07-06 Thread Kyle Sluder
On Mon, Jul 6, 2015, at 07:57 PM, Rick Mann wrote: > > > On Jul 6, 2015, at 17:54 , Charles Srstka wrote: > > > > I’ve occasionally had issues getting Xcode to connect outlets and actions. > > My workaround for it is to open the Assistant view, and drag from your view > > into the source file,