Re: PList Data Typing

2014-12-15 Thread Ken Thomases
On Dec 15, 2014, at 4:10 PM, Kevin Bracey wrote: > I'm needing to read in a PList, that others have designed, I have no control > over the input. > > One of the Keys stores either a String, Number or Boolean value. > > Checking for the NSString is straight forward. > > How can I tell if the V

Re: Replace -lockFocus with Block-Based Drawing Method (was NSCustomImageRep…)

2014-12-17 Thread Ken Thomases
On Dec 17, 2014, at 6:52 AM, Jerry Krinock wrote: > I think I did what the "High Resolution Guidelines for OS X” document > suggested for drawing offscreen vector images. See code snip below. > > The result looks the same to me. It’s OK with the old code, and OK with the > new code. > > To

Re: Observing changes in Table

2014-12-17 Thread Ken Thomases
On Dec 17, 2014, at 7:10 AM, Gerriet M. Denkmann wrote: > TableView has textDidEndEditing, but this is deprecated. > The delegate has ...shouldEditTableColumn... but I need ...didEdit... > > The table is cell-based. -textDidEndEditing: is only deprecated in the sense that all methods specific

Re: Added Toolbar, now main window can't be resized

2014-12-17 Thread Ken Thomases
For what it's worth, I have an app with a window like you describe: toolbar, split view with source list on the left and content on the right. It uses auto layout and has no problem resizing even though the split view's delegate implements those methods listed in the release notes. What that m

Re: Yosemite-like Toolbar: Segmented Controls, Buttons, Template Images?

2014-12-17 Thread Ken Thomases
On Dec 17, 2014, at 11:40 PM, Jerry Krinock wrote: > • It would be *really* nice if -[NSImage setTemplate:YES] sent to a > monochrome image would cause it to reverse brightness depending on the > highlight color, the way it works with Status Item icons in the menu bar, or > even better yet, tu

Re: Yosemite-like Toolbar: Segmented Controls, Buttons, Template Images?

2014-12-18 Thread Ken Thomases
On Dec 18, 2014, at 12:57 AM, Jerry Krinock wrote: > On 2014 Dec 17, at 22:32, Ken Thomases wrote: > >> If you use a proper template image in a button whose showsStateBy includes >> NSChangeBackgroundCellMask, it will show a blue effect when the button's >> st

Re: view problems

2014-12-20 Thread Ken Thomases
On Dec 20, 2014, at 2:08 PM, H Miersch wrote: > i have a window with a custom view in it. I add another view in code and then > i add a couple of constraints to centre the new view in its superview. so far > so good. > > if i DON'T call [self setTranslatesAutoresizingMaskIntoConstraints:NO]; o

Re: Regenerating the dock image of a miniaturized NSWindow

2014-12-26 Thread Ken Thomases
On Dec 26, 2014, at 3:50 AM, Arjan van Leeuwen wrote: > After I have called [NSWindow miniaturize], is it possible to refresh the > miniaturized dock image somehow? I have changing contents in a window, and > would like to update the miniaturization to reflect the actual contents. Try [window.do

Re: Replace -lockFocus with Block-Based Drawing Method

2014-12-30 Thread Ken Thomases
On Dec 30, 2014, at 9:57 PM, Jerry Krinock wrote: > Just to clarify on the guidelines for using -lockFocus in the Resolution > Independent world… > > Apple’s advice to avoid -lockFocus [1] only applies to drawing into NSImage > objects, which is called “off-screen drawing”. Using -lockFocus i

Re: Image Sizing

2014-12-31 Thread Ken Thomases
On Dec 31, 2014, at 7:04 AM, Charles Jenkins wrote: > First, am I right that there is no way to ask an NSToolbar or NSToolbarImage > what size its graphic should be? In searching the documentation, I found it > seems to say toolbar images come in two sizes, 32x32 or 24x24, and if they > need t

Re: Rearranging NSOutlineView via drag-and-drop

2015-01-04 Thread Ken Thomases
On Jan 4, 2015, at 7:22 AM, Charles Jenkins wrote: > moveItemAtIndex:… does indeed move the items around to the proper places in > the tree, but the outline view control doesn’t update disclosure triangles. > Meaning, if I drag an item’s only child someplace else, the now-childless > parent ke

Re: Rearranging NSOutlineView via drag-and-drop

2015-01-05 Thread Ken Thomases
On Jan 5, 2015, at 12:48 PM, Charles Jenkins wrote: > Well, the view-based outline view calls my delegate to get the view pointer > for a given item, and in response my delegate dutifully creates one, sets its > text and image, and hands it over. But after that the item view I created is > own

Re: URLByResolvingBookmarkData not case sensitive

2015-01-06 Thread Ken Thomases
On Jan 6, 2015, at 7:40 PM, Kyle Sluder wrote: > On Jan 6, 2015, at 5:05 PM, Trygve Inda wrote: > >> If I bookmark a file and the case of any folders or the file itself changes, >> then later when I extract the path from the bookmark I want it to reflect >> the new case of the path as it now ex

Re: URLByResolvingBookmarkData not case sensitive

2015-01-07 Thread Ken Thomases
On Jan 6, 2015, at 11:37 PM, Trygve Inda wrote: >> On Jan 6, 2015, at 8:43 PM, Trygve Inda wrote: >>> >>> Ultimately what I need to able to do is compare a bookmark to a path. >> >> Why? Or rather, what is the reason underlying that one? > > I am keeping a database of files that the user adds

Re: NSScrollView autolayout (10.10)

2015-01-07 Thread Ken Thomases
On Jan 7, 2015, at 6:26 AM, Roland King wrote: > I want an NSStackView which can be scrolled. I dragged an NSScrollView out in > IB, that gives me a scrollview, the scrollers, a clip view and a child NSView > of the clip view, which IB doesn’t want you to delete. I dragged my > NSStackView out

Re: ARC query

2015-01-07 Thread Ken Thomases
On Jan 7, 2015, at 9:32 AM, Jonathan Mitchell wrote: > I use this construct quite a lot without really thinking about it under ARC > I don’t retain a reference to the alert. > > Does -beginSheetModalForWindow: completionHandler: cause the receiver to be > retained until after the completion han

Re: Displaying a scaling, relative time or date

2015-01-07 Thread Ken Thomases
On Jan 7, 2015, at 6:18 PM, Graham Cox wrote: > I want a label in my interface to display a relative time using a "sensible" > approximate scale depending on the value. I'm not sure if I can use > NSDateFormatter for this - it seems it's a bit too fixed in using only the > units you assign. >

Re: Machine sleep & wake notifications in a daemon

2015-01-08 Thread Ken Thomases
On Jan 8, 2015, at 4:03 PM, Andrew Keller wrote: > I would like to receive machine sleep and wake notifications in my daemon. > In my Cocoa GUI application, I was able to easily follow the sample code > under Listing 1 on the page >

Re: Machine sleep & wake notifications in a daemon

2015-01-08 Thread Ken Thomases
On Jan 8, 2015, at 4:54 PM, Andrew Keller wrote: > On Jan 8, 2015, at 5:20 PM, Ken Thomases wrote: > >> On Jan 8, 2015, at 4:03 PM, Andrew Keller wrote: >> >>> <https://developer.apple.com/library/mac/qa/qa1340/_index.html> > > Yes. It looks very pr

Re: NSURL resourceValuesForKeys NSURLPathKey

2015-01-08 Thread Ken Thomases
On Jan 8, 2015, at 6:31 PM, Trygve Inda wrote: > I call: > > NSData* bookmarkData = [url > bookmarkDataWithOptions:NSURLBookmarkCreationMinimalBookmark > includingResourceValuesForKeys:nil > relativeToURL:nil > error:&inError]; > > And later: > > NSDictionary* dict = [NSURL resourceValuesForKe

Re: Machine sleep & wake notifications in a daemon

2015-01-12 Thread Ken Thomases
On Jan 12, 2015, at 10:30 AM, Andrew Keller wrote: > On Jan 8, 2015, at 7:00 PM, Andrew Keller wrote: > >> On Jan 8, 2015, at 6:11 PM, Greg Parker wrote: >> >>> On Jan 8, 2015, at 2:54 PM, Andrew Keller wrote: >>> >>>> On Jan 8, 2015, at 5:

Re: Directory navigated to by menu File > Open

2015-01-15 Thread Ken Thomases
On Jan 15, 2015, at 6:16 PM, Jerry Krinock wrote: > I have noticed that the directory which is navigated to in the File > Open > dialog of my NSDocument-based application does not give what I expect, and am > trying to control it. > So, great, I thought, just override -currentDirectory in the

Re: Directory navigated to by menu File > Open

2015-01-16 Thread Ken Thomases
On Jan 16, 2015, at 3:53 AM, Jerry Krinock wrote: > Also, I’d forgotten about -[NSSavePanel setDirectoryURL:]. TextEdit does not > invoke this method, so that does not explain the behavior. And yes I agree > that overriding both -runModalOpenPanel:forTypes: and > -beginOpenPanel:forTypes:com

Re: FSEventStreamCreate: BUG in libdispatch client: kevent[EVFILT_WRITE]

2015-01-17 Thread Ken Thomases
On Jan 17, 2015, at 2:27 PM, Trygve Inda wrote: > I am getting an error in the Console when shutting down a FSEvent monitor > I have verified that [self prefBundlePath] points to a valid directory (a > prefpane bundle). > > BUG in libdispatch client: kevent[EVFILT_WRITE] delete: "No such file or

Re: Fast Enumeration and remove elements

2015-01-18 Thread Ken Thomases
On Jan 18, 2015, at 2:45 PM, Trygve Inda wrote: > So is this safe... > > NSMutableDictionary* collection; // keys are myID, values are MyObject > > for (MyObject* object in [[self collection] allValues]) > { >[collection removeObjectForKey:[object myID]]; > } > > It would seem that this i

Re: animating an NSStackView

2015-01-20 Thread Ken Thomases
On Jan 20, 2015, at 7:28 AM, Roland King wrote: > I'm trying to see if I can make insertions/deletions in an NSStackView a > little more animated. So I did the simplest thing I could think of, wrapped > the insert/delete in an NSAnimationContext, made the control layer-backed, > turned on impl

Re: Inexplicable Crash in -[NSAppleScript executeAndReturnError:]

2015-01-23 Thread Ken Thomases
On Jan 23, 2015, at 1:25 PM, Jerry Krinock wrote: > Can anyone explain this weird crash report I got from a user and symbolized? > The last thing my code does (frame 24 in the call stack below), is to send > -[NSAppleScript executeAndReturnError:]. The crash says someone tried to set > a *di

Re: Subclassing NSControl and inheritance of target, action properties

2015-01-29 Thread Ken Thomases
On Jan 29, 2015, at 10:54 PM, Quincey Morris wrote: > On Jan 29, 2015, at 19:47 , Greg Parker wrote: >> >> `atomic` makes a big difference for a strong or weak property of object type >> because objects have retain counts. > > Er, I feel stupid but I don’t understand. How do the retain count

Re: Subclassing NSControl and inheritance of target, action properties

2015-01-29 Thread Ken Thomases
On Jan 29, 2015, at 11:53 PM, Quincey Morris wrote: > On Jan 29, 2015, at 21:16 , Ken Thomases wrote: >> >> the getter has to do the equivalent of retain+autorelease atomically > > I was thinking that the same would have to be true of local variable > accesses, too,

Re: Subclassing NSControl and inheritance of target, action properties

2015-01-29 Thread Ken Thomases
On Jan 30, 2015, at 12:49 AM, Quincey Morris wrote: > On Jan 29, 2015, at 22:21 , Ken Thomases wrote: >> >> Huh? It has to be an autorelease and not a release because the object needs >> to survive to the caller's scope. > > "Release" meant “eventu

Re: Show count of Core Data to-many relationship in NSTableView cell with bindings?

2015-02-06 Thread Ken Thomases
On Feb 6, 2015, at 1:43 AM, Steve Mills wrote: > I have a Core Data entity called Keyword that has a to-many relationship to > another entity called Image. In a table that displays these Keywords, I want > one column to show the number of Images that use that particular Keyword. I > tried sett

Re: Modal Window Failure on 10.10.2

2015-02-08 Thread Ken Thomases
On Feb 8, 2015, at 5:44 PM, Charles Jenkins wrote: > I updated my OS yesterday, and now my modal window doesn’t work (which > probably means I’m doing it wrong and just got lucky before). > > I created the window by asking XCode to create a subclass of > NSWindowController and making sure the

Re: Running window as a sheet

2015-02-09 Thread Ken Thomases
On Feb 9, 2015, at 9:08 PM, Charles Jenkins wrote: > So I have a window that now works fine as a modal window, but because I don’t > like where it appears on the screen, I’m attempting to run it as a sheet > instead. My Cocoa books and the NSWindow documentation seem to suggest that > any wind

Re: Using multiple bindings to enable a button

2015-02-10 Thread Ken Thomases
On Feb 11, 2015, at 12:31 AM, Quincey Morris wrote: > On Feb 10, 2015, at 21:45 , Steve Mills wrote: >> >> I'm not sure about the KVO compliancy. I'm still a newbie in this area. Let >> me give you the rundown on the stuff that deals with it. >> >> @interface WindController : NSWindowControl

Re: Solved: Re: Using multiple bindings to enable a button

2015-02-11 Thread Ken Thomases
On Feb 11, 2015, at 1:25 PM, Steve Mills wrote: > On Feb 11, 2015, at 13:06:20, Steve Mills wrote: >> >> This also sparked my understanding of the other binding attributes, like >> Multiple Values Placeholder and such, resulting in me not needing my special >> EnableOnlyFor1ItemXformer value

Re: NSWindowControllers and NSWindow

2015-02-16 Thread Ken Thomases
On Feb 16, 2015, at 8:17 AM, Dave wrote: > I’ve just started a new Application and I”m wondering what the best/standard > way of setting it up. I recommend that you follow the advice in this article: . Ch

Re: NSWindowControllers and NSWindow

2015-02-16 Thread Ken Thomases
On Feb 16, 2015, at 9:24 AM, Dave wrote: >> I recommend that you follow the advice in this article: >> . > > Thanks for this, it seems to be saying there is no need for a separate Window > Subclass and tha

Re: NSWindowControllers and NSWindow

2015-02-16 Thread Ken Thomases
On Feb 16, 2015, at 11:55 AM, Dave wrote: >> You never want a NIB for the window controller that's separate from the NIB >> containing the window. You want a single NIB for the window which the >> window controller will load and be the owner of. The NIB will *not* >> "contain" the window con

Re: NSWindowControllers and NSWindow

2015-02-16 Thread Ken Thomases
On Feb 16, 2015, at 12:39 PM, Bill Cheeseman wrote: > Although I follow Mike Ash's advice, I have separate MainMenu.xib and > MainWindow.xib files instead of a single window.xib file. My MainMenu.xib > contains the application's menu bar but no window. The construction of this sentence suggest

Re: -beginSheet:modalForWindow:modalDelegate:didEndSelector

2015-02-20 Thread Ken Thomases
On Feb 20, 2015, at 2:34 PM, Raglan T. Tiger wrote: > So, I added an outlet of the app window and get: > > 2015-02-20 13:28:21.563 [5792:181060] aboutWindowController > > 2015-02-20 13:28:21.563 [5792:181060] aboutWindowController window 0x6180001edb00> > 2015-02-20 13:28:21.563 [5792:181060]

Re: get class of a method

2015-02-22 Thread Ken Thomases
On Feb 22, 2015, at 3:01 PM, Jack Brindle wrote: > Doesn’t [self class] do this? The method is within whatever self is, so it > seems appropriate that [self class] > would provide what you want. Although the subject wasn't clear, the body makes it clear he's looking for the return type of a me

Re: Displaying multiple errors in NSOpenPanel beginSheetModalForWindow:completionHandler:

2015-02-24 Thread Ken Thomases
On Feb 24, 2015, at 3:09 AM, Steve Mills wrote: > I've been trying tons of different things, but can't make this work. I'm > running an NSOpenPanel with beginSheetModalForWindow:completionHandler: to > choose a destination folder. In the completionHandler I'm processing 1 or > more files by co

Re: Responsive scrolling control with lots of subviews

2015-03-02 Thread Ken Thomases
On Mar 2, 2015, at 8:54 AM, Ben wrote: > From a time profile, the majority of my code being called is funnelled > through a single method which handles the adding/positioning/removing of > views within the visible area. The slow areas are: > > 8% - Instantiating new views (happens early on, vi

Re: Responsive scrolling control with lots of subviews

2015-03-02 Thread Ken Thomases
On Mar 2, 2015, at 9:45 AM, Uli Kusterer wrote: > Are you re-setting *all* the views or only hiding views that scroll out and > moving unused views to newly exposed areas? We've been doing stuff like that > in various spots and performance is fine. One thing that might help is to > make each t

Re: NSTextField highlight

2015-03-02 Thread Ken Thomases
On Mar 2, 2015, at 3:51 PM, edward taffel wrote: > has anyone had success in changing NSTextField’s default highlight? e.g., > given bright text on a dark background, the default highlight is not > serviceable. i had hoped subclassing NSTextFieldCell & overriding > -(id)_highlightColorForCell:

Re: Bindings in view-based tables

2015-03-05 Thread Ken Thomases
On Mar 5, 2015, at 6:09 PM, Shane Stanley wrote: > On 6 Mar 2015, at 10:32 am, Quincey Morris > wrote: >> >> Er, what exactly was bound to what? > > In the cell-based table, the table's (sole) column's Font Size is bound to > the shared user defaults controller with a Controller Key of value

Re: Bindings in view-based tables

2015-03-05 Thread Ken Thomases
On Mar 5, 2015, at 8:15 PM, Shane Stanley wrote: > On 6 Mar 2015, at 12:06 pm, Ken Thomases wrote: >> >> I _think_ connections to File's Owner are restored when the cell view NIB is >> loaded, but the File's Owner of the sub-NIB may not be the same as the &

Re: Avoid staircasing by creating keyPath dynamically possible?

2015-03-07 Thread Ken Thomases
On Mar 7, 2015, at 5:02 AM, Diederik Meijer wrote: > This is part of XML parsing with NSXMLParser, is there any way to avoid this > type of staircasing by constructing a keyPath dynamically? > >if (self.nestingLevel == 1) { [[[self.rootparser nodeTree] > lastObject][@"items"] addObject:dic

Re: Avoid staircasing by creating keyPath dynamically possible?

2015-03-07 Thread Ken Thomases
On Mar 7, 2015, at 6:34 AM, Diederik Meijer wrote: >> On 07 Mar 2015, at 12:36, Ken Thomases wrote: >> >>> On Mar 7, 2015, at 5:02 AM, Diederik Meijer wrote: >>> >>> This is part of XML parsing with NSXMLParser, is there any way to avoid >>

Re: Drawing inside an NSImage?

2015-03-08 Thread Ken Thomases
On Mar 8, 2015, at 6:12 PM, Patrick J. Collins wrote: > I have an NSView which has in its "drawRect:" method: > >NSColor *backgroundColor = [NSColor colorWithPatternImage:self.image]; >[backgroundColor setFill]; > > ... > > the image method does: > > -(NSImage *)image { > if (!

Re: Programmatically putting attributed string RTF on the pasteboard

2015-03-11 Thread Ken Thomases
On Mar 11, 2015, at 3:36 AM, Charles Jenkins wrote: > I’m having a bit of difficulty learning how to use the pasteboard. I have a > text view which holds the text in a rich attributed string. I determined that > the built-in methods for cutting and pasting were screwing up my data because > no

Re: Programmatically putting attributed string RTF on the pasteboard

2015-03-12 Thread Ken Thomases
On Mar 11, 2015, at 6:18 AM, Charles Jenkins wrote: > Thank you, Ken. You're welcome. > Would it work to use the writing options to specify that all the types are > only promised? I think so. The docs for -writableTypesForPasteboard: say that, _by default_, the data for the first type is pu

Re: Full-screen mode broken after upgrading to Yosemite

2015-03-13 Thread Ken Thomases
On Mar 13, 2015, at 4:29 PM, Daryle Walker wrote: > My main browser window supports full-screen and optimized zoom. In Yosemite, > those two functions share the green titlebar button. When I activate > full-screen mode, with either the green button or the menu item, the window > freezes withou

Re: Trying to hide a NSProgressIndicator upon finishing of table rendering

2015-03-15 Thread Ken Thomases
On Mar 15, 2015, at 7:58 PM, Patrick J. Collins wrote: > And guess what? result is always false... Which makes me wonder why in their > documentation do they suggest that result == nil check? But, I am confused > why > it's recreating views from scratch anytime the table content changes? Is

Re: another question about view based NSTableViews

2015-03-15 Thread Ken Thomases
On Mar 15, 2015, at 8:24 PM, Patrick J. Collins wrote: > So, I have my NSTableView which is made up of NSTextFields as cells... > How do I handle knowing when the value of one of these text fields > change? > > The docs say that with a view based table, the subviews (i.e. columns) > should hand

Re: prevent UIAgent with floating NSPanel stealing focus?

2015-03-16 Thread Ken Thomases
On Mar 16, 2015, at 4:50 PM, has wrote: > Quick question as I'm guessing the answer is "no", but I've a UIAgent that > floats an NSPanel above other apps and I'm wondering if there's any way to > avoid 1. having to click not once but twice to put the cursor in a text field > when the panel isn

Re: Text fields bound to numerical property - commas in number

2015-03-18 Thread Ken Thomases
On Mar 18, 2015, at 7:56 AM, Jonathan Taylor wrote: > I have a text field in my GUI bound to a property of type 'double'. The text > field does not have any explicit number formatter attached to it. When I set > the property e.g. to 22000 then it appears in the text field as: > 22,000 > OK, fa

Re: windowDidLoad not getting called

2015-03-19 Thread Ken Thomases
On Mar 19, 2015, at 1:24 PM, Dave wrote: > The Window Controller is instantiated with this code: > > myWindowController = [[LTWWindowControllerX alloc] initWithWindowKind:@""]; > [myWindowController loadWindow]; You shouldn't call -loadWindow. -loadWindow is an override point. See the docs f

Re: windowDidLoad not getting called

2015-03-19 Thread Ken Thomases
On Mar 19, 2015, at 2:49 PM, Bill Cheeseman wrote: > On Mar 19, 2015, at 2:34 PM, Ken Thomases wrote: >> >> To force the window controller to load the window, request its "window" >> property value or call -showWindow: on it (if you want to show the window). >

Re: windowDidLoad not getting called

2015-03-19 Thread Ken Thomases
On Mar 19, 2015, at 3:39 PM, Bill Cheeseman wrote: > I believe you're mistaken when you say that the "Visible at Launch" setting > doesn't result in a call to -windowDidLoad. I'm using it now in a rewrite of > my UI Browser product, and it triggers -windowDidLoad exactly as I expected. A windo

Re: NSTextField with a NSTableView completion list - suggestions for text field

2015-03-20 Thread Ken Thomases
On Mar 19, 2015, at 6:20 PM, Alex Kac wrote: > I have a few places where I’d like to have essentially an NSTextField with an > auto-complete - but its not a combo-box. The closest I can come up with what > I’m looking for is the Apple Calendar location field where it brings up a > search auto-

Re: windowDidLoad not getting called

2015-03-20 Thread Ken Thomases
On Mar 20, 2015, at 3:54 AM, Bill Cheeseman wrote: > My launch sequence goes like this: My Info.plist file designates MainMenu as > the application's principal nib file. My MainMenu nib file names > NSApplication as file's owner, it contains the menu bar and my archived > appDelegate object, a

Re: Inserting a task into the run loop

2015-03-22 Thread Ken Thomases
On Mar 22, 2015, at 5:23 PM, Graham Cox wrote: > I need my code to run all the time. It's not heavyweight processing, so it > isn't going to be a huge drain on anything, but it does need to have frequent > calls. My timer approach does keep the run loop awake, but it feels a bit off > to be us

Re: Swift: How to determine if a Character represents whitespace?

2015-04-02 Thread Ken Thomases
On Apr 2, 2015, at 6:54 AM, Charles Jenkins wrote: > What would be nice is a way to count leading and trailing characters in place > while the thing is still an NSAttributedString--without using > NSAttributedString.string to convert to a Swift string in the first place. NSAttributedString.str

Re: NSWindow Subclass close/dealloc question

2015-04-02 Thread Ken Thomases
On Apr 2, 2015, at 10:56 AM, Dave wrote: > I’m getting a crash in dealloc in an NSWindow Subclass. > If I run this, then I get a crash when the autorelease pool is drained. > However, if I take out the line: > > [super close]; > > in my close method, all works fine. > > Is this expected? If

Re: NSWindow Subclass close/dealloc question

2015-04-02 Thread Ken Thomases
On Apr 2, 2015, at 11:53 AM, Dave wrote: > On 2 Apr 2015, at 17:09, Ken Thomases wrote: >> >> On Apr 2, 2015, at 10:56 AM, Dave wrote: >> >>> I’m getting a crash in dealloc in an NSWindow Subclass. >> >>> If I run this, then I get a crash when

Re: Where are my bytes?

2015-04-04 Thread Ken Thomases
On Apr 4, 2015, at 4:23 AM, Gerriet M. Denkmann wrote: > When I look at " /Library/Dictionaries/Apple > Dictionary.dictionary/Contents/Info.plist" in Finder, it shows a preview and > says 5 kB. Ok. > > But: Finder → FIle → Get Info says: > 4,893 bytes (Zero bytes on disk) > > And lstat shows:

Re: Finder not responding to [NSRunningApplication activateWithOptions]

2015-04-08 Thread Ken Thomases
On Apr 8, 2015, at 9:19 AM, Tomáš Znamenáček wrote: > I should have mentioned that Finder behaves unlike other apps in this > regard. If I do the same with any other app, the app is correctly focused, > stealing focus from whatever app was focused before. (And the menu bar on > the display “gets

Re: Force NSTextField (multiline wrapping label) to grow vertically?

2015-04-09 Thread Ken Thomases
On Apr 9, 2015, at 11:24 AM, Steve Mills wrote: > I can't figure out a combination of constraints and hugging/compression > values that will cause an NSTextField used as a multiline wrapping label to > grow vertically when the window is resized horizontally. > I tried setting the label's verti

Re: Does GCD auto-limit concurrent tasks to number of cores?

2015-04-09 Thread Ken Thomases
On Apr 9, 2015, at 2:23 PM, Clark Smith Cox III wrote: > On Apr 9, 2015, at 12:07, Carl Hoefs wrote: >> >> I have a highly CPU-bound project that parallelizes well. A small case has >> about 5000 tasks that can execute concurrently (max is ~100,000). I would >> like to use GCD queues to take ad

Re: Force NSTextField (multiline wrapping label) to grow vertically?

2015-04-09 Thread Ken Thomases
On Apr 9, 2015, at 1:53 PM, Steve Mills wrote: > On Apr 9, 2015, at 13:28:33, Ken Thomases wrote: >> >> In a parent view, you could override the -layout method with something like >> this to adjust it dynamically: >> >> - (void) layout >> { >

Re: UTI case doesn't matter sometimes?

2015-04-13 Thread Ken Thomases
On Apr 13, 2015, at 2:17 PM, Sean McBride wrote: > On Mon, 13 Apr 2015 14:09:06 -0500, Steve Mills said: > >> So, should string comparisons be case-insensitive when comparing UTIs? >> If not, then things fail. > > Don't compare as strings, use UTTypeConformsTo(). Or -[NSWorkspace type:conforms

Re: NSTableView content height

2015-04-15 Thread Ken Thomases
On Apr 15, 2015, at 12:41 AM, Alex Kac wrote: > I’m failing to find the proper way to do this. Given an NSTableView, I’d > like to size its parent view to the height of all the rows/content/headers > of that table view so that there is no scrolling. > > Someone suggested: > > [_scrollView.docum

Re: Drag and Drop from Photos

2015-04-25 Thread Ken Thomases
On Apr 25, 2015, at 8:37 PM, Graham Cox wrote: > I’d like a user to be able to directly drag and drop an image from Photos > into my app. Currently the drag is rejected, though I’m registering for all > of the usual types - NSURLs, Filenames, Images, etc. How can I find out what > drag flavour

Re: Drag and Drop from Photos

2015-04-25 Thread Ken Thomases
On Apr 25, 2015, at 10:25 PM, Graham Cox wrote: > Thanks Ken, that’s helpful. You're welcome. > … I see the following on the pasteboard: > > drag content: ( > > "dyn.ah62d4rv4gu8yc6durvwwa3xmrvw1gkdusm1044pxqyuha2pxsvw0e55bsmwca7d3sbwu", >"Apple files promise pasteboard type", >"co

Re: Cocoa window stops responding

2015-04-28 Thread Ken Thomases
On Apr 29, 2015, at 12:38 AM, Nisar Ahmed wrote: > I think I have found the culprit, I have subclassed NSOpenGLView where in > drawRect, I am rendering a IOSurface based texture using CVDisplayLink, > although I don't know why it is causing the screen to freeze but when I > moved the rendering co

Re: static analyzers says I'm leaking, I _think_ I'm not

2015-05-06 Thread Ken Thomases
On May 6, 2015, at 3:57 PM, Michael David Crawford wrote: > // LifeGrid.h > @property (assign, nonatomic) GridCycler *cycler; > > // Lifegrid.m - init > self.cycler = [[GridCycler alloc] initWithGrid: self]; // Potential > leak of an object > if ( nil == self.cycler ) goto cycler_failed; > > /

Re: static analyzers says I'm leaking, I _think_ I'm not

2015-05-06 Thread Ken Thomases
On May 6, 2015, at 4:40 PM, Aaron Montgomery wrote: > If the property is set to "retain", then the line > > self.cycler = [[[….initWithGrid:self] autorelease] > > will cause the setter to retain the passed in object, so after this line, > _cycler will have a (heuristic) retain count of 2 (an a

Re: Help: NSScrollView is resizing its documentView down to (0, 0)

2015-05-07 Thread Ken Thomases
When using auto layout with a scroll view, you would want at least constraints to fix the position of the document view within the clip view. Usually, you fix it to the top-left. If the document view should re-flow its content to fit the width of the clip view, like a text view or collection v

Re: Limiting GCD concurrent queues

2015-05-08 Thread Ken Thomases
On May 8, 2015, at 1:51 PM, Carl Hoefs wrote: > I need to limit a GCD concurrent queue to a specific number of concurrently > executing tasks (less than the number of cores available). > I was hoping an API like the following might be lurking around somewhere: > >gcdConcQueue = dispatch_qu

Re: Tracking the retain count

2015-05-18 Thread Ken Thomases
On May 18, 2015, at 12:52 PM, Britt Durbrow wrote: > In order to maintain graph coherency the object pool controller must ensure > that there is only ever one object in memory with a particular UUID. > Consequently, I can’t just have the object pool controller release the > objects without as

Re: NSFontPanel swamping the responder chain (and crashing)

2015-05-19 Thread Ken Thomases
On May 19, 2015, at 9:26 PM, Graham Cox wrote: > Just to be clear: it crashes when there is no involvement of my code at all - > this is the stack trace without the override, but with zombies enabled: > > Crashed Thread:0 Dispatch queue: com.apple.main-thread > > Exception Type:

Re: Stupid Cocoa question. How can you tell if the object you are looking at is a property or an ivar?

2015-05-20 Thread Ken Thomases
On May 20, 2015, at 3:04 PM, Alex Zavatone wrote: > Many times in the classes, an ivar is defined in the @interface of the class. > Sometimes not. Then sometimes, the same name of the ivar is used in the > class and defined as a property and @synthesized. > > Sometimes not. > Now, I remembe

Re: Stupid Cocoa question. How can you tell if the object you are looking at is a property or an ivar?

2015-05-20 Thread Ken Thomases
Have to correct a typo: On May 20, 2015, at 3:22 PM, Ken Thomases wrote: > You are accessing a property if you use explicit message sending ([someObject > someProperty] or [someObject setSomeProperty:someValue]) or if you use > implicit message sending view dot syntax (someObject.som

Re: Stupid Cocoa question. How can you tell if the object you are looking at is a property or an ivar?

2015-05-20 Thread Ken Thomases
On May 20, 2015, at 6:57 PM, Eric Wing wrote: > On 5/20/15, Jens Alfke wrote: >> >>> On May 20, 2015, at 4:08 PM, Eric Wing wrote: >>> >>> You could use the Objective-C runtime to find out which things are >>> properties. >> >> You could, but isn't it a lot easier to just look at the charact

Re: What is overwriting 'isa' with 0xbaddc0dedeadbead ?

2015-05-23 Thread Ken Thomases
On May 23, 2015, at 12:54 PM, Jens Alfke wrote: > On May 23, 2015, at 9:20 AM, Greg Parker wrote: >> >> free() does that sometimes. If zombies doesn't find anything then try guard >> malloc. > > Good suggestion! I’d forgotten about guard malloc. This changes the crash; > now the parameter to

Re: Problem with Outline View and Manual Memory Management

2015-05-26 Thread Ken Thomases
On May 26, 2015, at 1:34 PM, Dave wrote: > When I run the App, it displays the Tree View fine and Populates the two > sections, but it crashes due to an over-release if I select a file based item > - I found this by using NSZombies - it gives the error: > > *** -[NSImage release]: message sent

Re: Using CFSTR() with const char * variable

2015-06-05 Thread Ken Thomases
On Jun 5, 2015, at 10:02 PM, Carl Hoefs wrote: > If I use CFSTR() in the following way: >CFStringRef mystr = CFSTR( "This is a string" ); > there is no problem. > > However, if I use a variable instead of “string” Xcode flags this as an error: >const char *mystring = "This is a string";

Re: Going back to non-ARC

2015-06-12 Thread Ken Thomases
On Jun 12, 2015, at 3:18 AM, John Brownie wrote: > Having worked with ARC code for a long while, I discovered an incompatibility > with a library that means I have to convert to non-ARC code. Before we address the how, let's make sure of the why. What is the nature of this incompatibility? A

Re: NSFontPanel for a modal window

2015-06-13 Thread Ken Thomases
On Jun 13, 2015, at 12:08 AM, Kurt Sutter wrote: > I have a modal window (run with [NSApp runModalForWindow:]) that sports a > view that is a descendant of NSTextView. The view has key focus and text is > selected therein. I then bring up the font panel calling [NSFontPanel > sharedFontPanel]

Re: Swift : iterating over NSArrayController arrangedObjects

2015-06-21 Thread Ken Thomases
On Jun 21, 2015, at 8:44 AM, Devarshi Kulshreshtha wrote: > I have an array controller which stores managed objects of entity > 'Student', I am trying to iterate over its content using below code: > > for (index, element) in downloadingFilesArrayController.arrangedObjects{ > > // wan

Re: Why would creating NSItemReplacementDirectory fail?

2015-06-24 Thread Ken Thomases
On Jun 24, 2015, at 3:39 PM, Jens Alfke wrote: > Anyone know what would cause NSFileManager (on OS X 10.10) to fail to create > an NSItemReplacementDirectory? We’re using this call to create a temporary > directory to save an intermediate file into, and it works fine on iOS and Mac > … except

Re: Overlapping NSViews and mouseDown Events

2015-06-24 Thread Ken Thomases
On Jun 24, 2015, at 7:44 PM, Thomas Wetmore wrote: > I am having a problem with NSViews and mouseDown events. > > I have defined a custom view (call it CardView) that is an NSOutlineView > centered in a slightly larger view used as a border. When displayed, a > CardView looks like an index car

Re: Overlapping NSViews and mouseDown Events

2015-06-24 Thread Ken Thomases
Please continue to reply to the list. That way: a) others can jump in to help, too; and b) others can see whatever advice I give to you (whether it turns out to be good or bad). On Jun 24, 2015, at 9:56 PM, Thomas Wetmore wrote: > Thanks. You're welcome. > I must admit that I will have to w

Re: Generic Bitmap to NSImage

2015-06-25 Thread Ken Thomases
> On Jun 25, 2015, at 6:10 PM, Raglan T. Tiger wrote: > > I have a list of generic bitmaps that are to be transformed to NSImages. The > list can be long, I haven limits on it. > > Here is the code I use to populate an NSMenu that gets set into an > NSPopUpButton. > > I need to speed this p

Re: Why would scroll events not arrive?

2015-06-26 Thread Ken Thomases
On Jun 26, 2015, at 2:47 AM, Martin Wierschin wrote: > The quick overview: sometimes after working in my OSX app, scroll wheel > events are no longer being dispatched to the key window's first responder. In > fact, after overriding -[NSApplication sendEvent:] I can see that after the > misbeha

Re: NSTableView row heights with auto layout and bindings

2015-07-01 Thread Ken Thomases
On Jun 30, 2015, at 11:56 AM, Jonathan Guy wrote: > Im trying to fix a problem with dynamic row heights with auto layout and > bindings which was working fine in an older build of Xcode but which now no > longer works. So my new attempt for the most part works but about 30% of my > row heights

Re: Issues with hiding NSTableColumns with autolayout

2015-07-02 Thread Ken Thomases
On Jul 2, 2015, at 12:25 PM, Jensen, Stephen C. (AFRC-R) wrote: > > The problem occurs when the user hides an NSTableColumn… I start getting > errors. For example, when I hide the column with the identifier “orgCode”, I > get the following: > > 2015-07-02 09:57:30.560 myApp[9975:303] Unable t

Re: How to resize accessory view to match Open panel

2015-07-09 Thread Ken Thomases
On Jul 9, 2015, at 7:05 AM, Jonathan Taylor wrote: > I gave it a try, setting what I thought should be needed, but it doesn’t seem > to be having the desired effect as yet. I have the nib file set to “Use > autolayout”, and have included the code you quoted. Even in a NIB set to use auto layo

Re: NSScrollView and NSTrackingArea woes

2015-07-16 Thread Ken Thomases
On Jul 16, 2015, at 8:19 PM, João Varela wrote: > > I’m passing [self bounds]. And no, I am not using NSTrackingInVisibleRect Why aren't you using that? That seems like the most obvious way to get correct behavior. The only reason you wouldn't use it is if you were adding a tracking area tha

<    1   2   3   4   5   6   7   8   9   10   >