Re: using constants from Obj-c in swift

2015-09-25 Thread Boyd Collier
Charles & Marco, Thanks very much for the prompt replies. I think I’d tried scrollView.borderType = .NSNoBorder (and lots of other things), but didn’t think of leaving off the “NS”. Boyd > On Sep 25, 2015, at 12:12 PM, Marco S Hyman wrote: > > On Sep 25, 2015, at 11:43 AM,

using constants from Obj-c in swift

2015-09-25 Thread Boyd Collier
In objective-c programs, there are places where one can write lines like the following: [scrollview setBorderType:NSNoBorder]; with NSNoBoarder being specified in an enum in NSView. But enums in swift are a different sort of beast, and I’ve not yet figured out what get the same job done. Is t

Re: swift: windowControllerDidLoadNib called twice

2015-09-23 Thread Boyd Collier
-and-on for 30 years, and once again I conclude that dogged persistence is an essential attribute. Undoubtedly, you know that, but I mention it for any newbs who might read this. Boyd > On Sep 18, 2015, at 6:02 PM, Quincey Morris > wrote: > > On Sep 18, 2015, at 16:40 ,

swift: windowControllerDidLoadNib called twice

2015-09-18 Thread Boyd Collier
I have a simple OS X project ( in swift 2.0 and Xcode 7.0) and that is supposed to open a .txt file and display the file’s contents in a document window. For the most part, it works correctly, except that windowControllerDidLoadNib is called twice each time I chose OpenFile from the file menu

Re: setting tab stops in swift

2015-08-29 Thread Boyd Collier
t 1.2, which is what I’m using, might not work; I’ll give swift 2 a try. Boyd > On Aug 27, 2015, at 5:47 PM, Jens Alfke wrote: > > >> On Aug 27, 2015, at 5:32 PM, Boyd Collier wrote: >> >> I’ve tried >> let theTabStop: NSTextTab = NSTextTab(NSLeftTa

setting tab stops in swift

2015-08-27 Thread Boyd Collier
I’m in the process of re-writing some obj-c code in swift for OS X and am stumped on how to set tab stops. The relevant obj-c code looks like this: [paraStyle setTabStops:[NSArray array]]; for (cnt = 1; cnt <= numStops; cnt++) { tabStop = [[NSTextTab alloc

Re: How to fix warning?

2013-08-28 Thread Boyd Collier
I think I understand what the problem is and the fix, but what does the < following the opening quote signify? Boyd On Aug 28, 2013, at 1:30 PM, Tom Davie wrote: > > On 28 Aug 2013, at 22:26, Dave wrote: > >> Hi, >> >> I am getting the following warning >> >> warning: format specifies t

Re: reverse scanner

2013-08-13 Thread Boyd Collier
i++ ) { subString = [testString substringWithRange:range]; theInt = [subString intValue]; range.location += digitsPerAllele; } } Begin forwarded message: > From: Boyd Collier > Subject: Re: reverse scanner > Date: August 12, 2013 1:00:56 PM PD

Re: reverse scanner

2013-08-12 Thread Boyd Collier
= [testString substringWithRange:range]; theInt = [subString intValue]; --alleles; range.location = remainder; range.length = digitsPerAllele; for (i = 0; i < alleles; i++ ) { subString = [testString substringWithRange:range]; theInt = [subString intValue];

reverse scanner

2013-08-10 Thread Boyd Collier
I'm dealing with a situation in which I have to scan strings that are separated by tabs, and for each string, I have to extract two numerical values, with these values being separated by a non-numerical character or not being separated by any character at all. I know the maximum number of chara

Re: The cost of using objects rather than plain C variables

2013-07-08 Thread Boyd Collier
Your suggestion sounded worth learning about, but it appears that there's no such creature as NSPointerValue. Did you perhaps mean NSPointerArray? On Jul 8, 2013, at 9:04 AM, Jens Alfke wrote: > > On Jul 7, 2013, at 1:37 PM, Frederick Bartram wrote: > >> Have you tried using NSData to s

error in using NSNumber's numberWithInt: method not flagged

2013-06-09 Thread Boyd Collier
Quite by chance, I stumbled on to what seems to be an error that ought to be caught by the compiler but wasn't. Here's an example: NSNumber *testNumber = [NSNumber numberWithInt:5]; int testInt = (int)testNumber; However, the value of testInt when running the above is wildly in

Re: what does "err = Resource busy" mean?

2013-05-26 Thread Boyd Collier
to my original query. Boyd On May 25, 2013, at 10:25 AM, Boyd Collier wrote: > I've been trying to track down a bug that crashes a document-based cocoa > application which seems to be caused by referring to an object that no longer > exists, but thus far haven't succeeded

what does "err = Resource busy" mean?

2013-05-25 Thread Boyd Collier
I've been trying to track down a bug that crashes a document-based cocoa application which seems to be caused by referring to an object that no longer exists, but thus far haven't succeeded in determining what that object is. Yes, I've tried using the Zombies tool in Instruments but to no avail

Re: fast enumeration

2013-04-27 Thread Boyd Collier
Excellent! Thanks very much for pointing this out. Boyd On Apr 27, 2013, at 11:21 AM, Jens Alfke wrote: > > On Apr 27, 2013, at 11:11 AM, Boyd Collier wrote: > >> NSEnumerator *myEnumerator = [arrayOfLabels objectEnumerator]; >> NSString *aString = [my

fast enumeration

2013-04-27 Thread Boyd Collier
I have an array of NSStrings that in some circumstances, I'd like to go through using fast enumeration starting with the second element in the array. After a bit of fooling around, I came up with the following, which seems to work: NSEnumerator *myEnumerator = [arrayOfLabels

Re: ARC Help

2013-03-25 Thread Boyd Collier
Quincey, I just got around to reading this thread and wanted to complement you on the clarity of your explanation. Boyd On Mar 22, 2013, at 3:27 PM, Quincey Morris wrote: > (sorry, this turned into a tome) > > The way properties are compiled has changed over time. Assuming you're using > th

Re: Dynamic library linking

2013-02-24 Thread Boyd Collier
I'm just getting started with python, so I'm certainly not qualified to comment on this specific problem. However, perhaps the following page may be useful to others getting started with python: http://wolfpaulus.com/journal/mac/installing_python_osx The site gives detailed instructions on ins

Re: Interface Builder button appearance

2013-02-04 Thread Boyd Collier
> >> >> >> Boyd >> >> >> >> On Feb 3, 2013, at 4:22 PM, Andy Lee wrote: >> >>> Can you post a screen shot and/or the nib file? >>> >>> --Andy >>> >>> On Feb 3, 2013, at 3:47 PM, Boyd Collier wrot

Interface Builder button appearance

2013-02-03 Thread Boyd Collier
Hi All, I have a nib with a Matrix of one column and 3 rows; in this there are 3 buttons cells of type Switch and Style Check. All are enabled. Recently I noticed that the square of the middle button is slightly darker that the other 2. Using Interface Builder's inspectors, I've tried everyt

what has happened to cocoa list?

2011-10-28 Thread Boyd Collier
It's been nearly a week since I've received anything from either cocoa list or Xcode list, and when I try to access http://lists.apple.com/, I get a proxy error saying > The proxy server received an invalid response from an upstream server. > The proxy server could not handle the request GET /.

spin_lock$VARIANT$mp in Sketch

2011-10-03 Thread Boyd Collier
Recently, a rather ordinary document-based application that I've been working on started misbehaving in the following way: If I create a new document, put some text into it, save it, and then try to open it again, I get a "EXEC_BAD_ACCESS" error. I spent a lot of time trying to find the bug th

Re: Cannot quit TextEdit

2011-09-19 Thread Boyd Collier
I just tried going through the sequence of steps that you described and also couldn't quit TextEdit. Along the way, I got several possibly revealing messages, one of which read "The operation couldn't be completed. (GSLibraryErrorDomain error 1." and one that read "The document 'A.txt' is on a

Re: Unnecessary Boolean Warning

2011-08-04 Thread Boyd Collier
At the risk of offending contributors to this list, whose knowledge and helpfulness I greatly respect, may I suggest that this thread has gone on long enough and that competing opinions on this topic would be better aired on some other list? Boyd___

Re: setting tab stops in a document

2010-06-07 Thread Boyd Collier
Paul, You're quite right. I commented out the call to shouldChangeTextInRange: and my code still does what I want. Thanks for pointing this out. I'll have a look at the documentation on methods for bracketing multiple changes to the text (after I get my head around efficiently creating trian

Re: setting tab stops in a document

2010-06-05 Thread Boyd Collier
AttributeName]; [paraStyle release]; [[textView textStorage] addAttributes:attrs range:NSMakeRange(0, [[[textView textStorage] string] length])]; [attrs release]; } Boyd On Jun 5, 2010, at 9:16 AM, Ross Carter wrote: > On Jun 5, 2010, at 1:09 AM, Boyd Collier

setting tab stops in a document

2010-06-04 Thread Boyd Collier
In an application I'm working on, I read in plain text files containing data to be analyzed. This uses a slightly-modified version of MyDocument.m that is produced as a result of starting a project with the template for NSDocument architecture. The modification that I made was to add a method

Re: constructing an NSString with va_list?

2010-02-27 Thread Boyd Collier
Take a look at http://www.cocoabuilder.com/archive/cocoa/205083-nslog-replacement-for-debugger-output.html I've been using Don Arnel's method as modified by Ken Thomases and it works very well. Boyd On Feb 27, 2010, at 4:02 PM, Rick Mann wrote: > I'm trying to improve our logging a bit. We

Re: Tabbed windows

2010-01-30 Thread Boyd Collier
Take a look at http://www.positivespinmedia.com/dev/PSMTabBarControl.html Maybe this would satisfy your needs. Boyd On Jan 29, 2010, at 3:40 PM, John Nairn wrote: > I tried to find a way to do tabbed windows like Safari. Since they appear > integrated into the window title bar, I thought they m

Re: NSOutlineView - how to have a default item selected

2009-11-27 Thread Boyd Collier
, Boyd Collier wrote: Mario Kušnjer's question reminded me of a question that I've been pondering about NSOutlineViews, namely, is there a way to have one item on the outline initialized in the selected state when the outline is first created? That is, when the window cont

NSOutlineView - how to have a default item selected

2009-11-25 Thread Boyd Collier
Mario Kušnjer's question reminded me of a question that I've been pondering about NSOutlineViews, namely, is there a way to have one item on the outline initialized in the selected state when the outline is first created? That is, when the window containing the outline is first displayed t

sortedArrayUsingFunction

2009-08-24 Thread Boyd Collier
The Discussion section in the current documentation for the NSArray method sortedArrayUsingFunction: context: reads "The new array contains references to the receiver’s elements, not copies of them." Nothing is said about incrementing the retain count of the objects in the array, which seems

Re: NSTabView Tutorial

2009-07-31 Thread Boyd Collier
A couple of years ago, I made a copy of MultipleNibTabView to play around with in learning how to use tab views. I still have this (slightly modified) copy but couldn't find the original version from Apple on my computer. However, if you'd like a copy of the version that I have, I'd be ha

Re: splitView not rendering correctly - where am I wrong ?

2009-07-16 Thread Boyd Collier
Hi Mario, Just want to add a short note to what Graham Cox said about using Interface Builder. Be sure to read the section "Setting a View's Autosizing Behavior" in Interface Builder User Guide and take some time to experiment with setting springs and struts for various views and subview

Re: C numerical libraries for integrating with Cocoa

2009-04-20 Thread Boyd Collier
Apr 17, 2009, at 1:53 PM, Boyd Collier wrote: Have you looked at the book "Numerical Recipes in C"? You can view a copy on-line at http://www.fizyka.umk.pl/nrbook/c1-0.pdf (and probably other places as well). Yes, maybe I should have mentioned that. (Actually, I'm old enough

Re: C numerical libraries for integrating with Cocoa

2009-04-17 Thread Boyd Collier
Have you looked at the book "Numerical Recipes in C"? You can view a copy on-line at http://www.fizyka.umk.pl/nrbook/c1-0.pdf (and probably other places as well). About 15 years ago, there was a commercially produced package called NuTools that would do everything you want, though perhaps

Re: Best way to get a non-repeating random number?

2009-04-14 Thread Boyd Collier
Here's what I've been using for shuffling an array of ints. It appears to work quite well and is very simple and fast. /* * shuffle * * This function is from http://www.stanford.edu/~blp/writings/clc/shuffle.html * Copyright ¨© 2004 Ben Pfaff * * BDC made change to add argument to allow

Re: NSData confusion

2009-03-20 Thread Boyd Collier
In a program I've been developing, I make a lot of use of matrices of doubles, and I've written some straight-forward code for doing this that might be of interest to you. If you're interested, I'd be happy to send it to you. Boyd On Mar 20, 2009, at 11:33 AM, James Maxwell wrote: I've

Re: Performance of calculation on float point numbers in a array • NSNumber in NSArray, or classi c C array?

2008-12-18 Thread Boyd Collier
Stanislas, I don't have anything useful to add to what others have already said about the merits of classic C arrays vs NSArray. However, since you mentioned wanting to calculate variance and other stats, if you aren't already familiar with the subtleties of algorithms for statistical ca

Interface Builder simulator

2008-11-21 Thread Boyd Collier
When I run Interface Simulator with one of my nibs, it is displayed in a semi-transparent form, though all the parts can be seen and work as expected. This (i.e. the transparency) is not the case for other nibs in the same project. But when I run the project that these nibs are a part of,

Re: Enumerating outlets automatically?

2008-11-06 Thread Boyd Collier
With some trepidation resulting from my lack of expertise, especially relative to those who have already offered suggestions, here is bit of code showing (a somewhat simplified version of) what I do. "self" in the next-to-last line refers to a controller. In the header for the controller,

Re: How do people typically implement dialog controllers?

2008-09-13 Thread Boyd Collier
I'm rather late coming into this discussion, but Graham's question addresses something that I puzzled over when, not too long ago, I started using Cocoa. As a newcomer wanting to avoid learning all about bindings, the approach I've taken is essentially the same as is summarized by Graham.

Re: My windows don't cascade

2008-06-07 Thread Boyd Collier
ou?" note at the bottom of the document page suggesting that a clarifying detail be added. Boyd On Jun 3, 2008, at 8:21 PM, Kyle Sluder wrote: On Tue, Jun 3, 2008 at 8:40 PM, Boyd Collier <[EMAIL PROTECTED]> wrote: Although everything now works as I think it should, the fact that

Re: My windows don't cascade

2008-06-03 Thread Boyd Collier
A couple of months ago, I too had this problem, but didn't satisfactorily solve it at that time. As my original posting noted, this change in behavior happened after upgrading to Leopard and Xcode 3.0. The recent posting by Stefan Haller prompted me to spend some time trying to figure out

Re: Bypassing Interface Builder

2008-05-14 Thread Boyd Collier
Andy, Just wanted to congratulate you for your exceptionally clear and succinct summary. If I'd had it when I first started using Interface Builder, it would have saved me a lot of head scratching (and occasional head-banging). Boyd On May 14, 2008, at 9:37 AM, Andy Lee wrote: On Ma

Re: binary search trees & binning

2008-04-16 Thread Boyd Collier
Thanks very much to everyone who replied to my question. You've given me a lot to think about; I'll crank up the old grey cells and see if I can digest all of it (sorry for the mixed metaphor). If I come up with any brilliant insights (very unlikely), I'll post a note. Boyd __

binary search trees & binning

2008-04-15 Thread Boyd Collier
Hello all, I need to place many thousands of doubles into size-class groups whose boundaries can be explicitly specified (much like one would do in constructing a histogram, though that's not what I'm doing). The number of size-classes won't be great, usually fewer than 100, say. It occ

Re: Southern California Coders?

2008-04-02 Thread Boyd Collier
I 'm also interested in knowing if there's a San Diego area group. Boyd On Apr 1, 2008, at 4:46 PM, James Merkel wrote: On Tue, 1 Apr 2008 15:23:40, Casey Becking wrote: Sorry to take any ones time if this has been discussed before. I was curious if there was any group meeting for Souther

doubleValue (for an NSString)

2008-03-21 Thread Boyd Collier
even ones telling me that I should take up knitting instead of programming, are welcome. Boyd On Mar 20, 2008, at 4:13 PM, Boyd Collier wrote: According to Apple's documents, the selector doubleValue returns 0.0 if the instance of an NSString that is the receiver "doesn’t begin

doubleValue (for an NSString)

2008-03-20 Thread Boyd Collier
According to Apple's documents, the selector doubleValue returns 0.0 if the instance of an NSString that is the receiver "doesn’t begin with a valid text representation of a floating-point number." Is there a simple way to distinguish between the string 0.0, which shouldn't be considered

Re: cascading windows in document architecture

2008-02-25 Thread Boyd Collier
Andrea, Thanks for the reply. In my case, the that aren't cascading are all of the same kind, i.e. just very plain text files. I've not yet figured out why this is happening, but perhaps someone will be able to point out something simple that we are overlooking. Boyd On Feb 25, 2008, a