Re: /Library/Application Support off limits? (Davidap)

2021-04-21 Thread Jonathan Prescott via Cocoa-dev
in the Apple documentation. Jonathan ___ 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

Re: sharing code between screensaver and regular app

2020-03-02 Thread Jonathan Prescott via Cocoa-dev
of this view is a property of your ViewController. If you look back at the link you referred to, you’ll see that is creating a ViewController that will be a container for you screen saver view. Although it’s in Swift, it should be straightforward to translate back into Objective-C Jonathan

Re: What is the preferred way to set NSTextView content from NSAttributedString?

2020-02-02 Thread Jonathan Prescott via Cocoa-dev
application related to my expert system interface. Jonathan > On Feb 2, 2020, at 3:37 PM, Jeff Younker wrote: > > Yes, I've set needsDisplay = true in my attempts to so far. Also needsLayout > = true. > > The question I've got though is what is the recommended way o

RE: What is the preferred way to set NSTextView content from NSAttributedString?

2020-02-02 Thread Jonathan Prescott via Cocoa-dev
“V.needsDisplay()” so that the next display cycle the view gets refreshed. Need to check the spelling of the method. Jonathan ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list

Re: UiView as slider with inertia

2018-09-30 Thread Jonathan Hull
What you want is UICollectionView. Make the numbers your cells, and use -targetContentOffset(forProposedContentOffset:, withScrollingVelocity:) to provide the snapping behavior. > On Sep 30, 2018, at 8:46 PM, Eric Dolecki wrote: > > I've been tasked with coming up with a few horizontal slider

Lazy calculation of tooltip text

2018-07-06 Thread Jonathan Taylor
I have a UI item (text field) that displays a tooltip when the user hovers over it. However, the information to be displayed in the tooltip is dynamic and relatively expensive to compute. At the moment the tooltip is bound to a string property which I manually update twice a second. It seems tha

Re: Creating NSTableView programmatically

2017-12-12 Thread Jonathan Mitchell
> On 12 Dec 2017, at 19:56, Richard Charles wrote: > > I always assumed the reason bindings never came over to iOS was they consumed > too much cpu power and were too difficult to understand. It seems evident > that 10 or 20 years from now Apple anticipates the bulk of it programmers > coming

Re: Creating NSTableView programmatically

2017-12-11 Thread Jonathan Mitchell
For NSTableCellView see https://developer.apple.com/documentation/appkit/nstablecellview objectValue is a property on NSTableCellView not on NStableView. The NSTableViewDelegate method - (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)

Re: NSDocument -canCloseDocumentWithDelegate::: not called when terminating

2017-08-30 Thread Jonathan Mitchell
> On 30 Aug 2017, at 18:30, Quincey Morris > wrote: > > On Aug 30, 2017, at 06:18 , Jonathan Mitchell <mailto:li...@mugginsoft.com>> wrote: >> >> My documents have a lot of variable user cancellable activity that must run >> prior to document closur

NSDocument -canCloseDocumentWithDelegate::: not called when terminating

2017-08-30 Thread Jonathan Mitchell
This is one from the archives: https://lists.apple.com/archives/cocoa-dev/2012/Jul/msg00740.html In short NSDocument -canCloseDocumentWithDelegate::: gets called on documents when closing the document window but only for dirty documents when closing the app via NSApp -terminate: (i.e.: the appl

Re: NSMutableParagraphStyle -paragraphSpacingBefore

2017-08-22 Thread Jonathan Mitchell
> On 22 Aug 2017, at 18:17, Quincey Morris > wrote: > > On Aug 22, 2017, at 10:02 , Jonathan Mitchell wrote: >> >> I don’t seem to be having much luck getting NSMutableParagraphStyle >> -paragraphSpacingBefore to render. > > To render where? I have n

NSMutableParagraphStyle -paragraphSpacingBefore

2017-08-22 Thread Jonathan Mitchell
macOS 10.12 I don’t seem to be having much luck getting NSMutableParagraphStyle -paragraphSpacingBefore to render. NSMutableParagraphStyle -paragraphSpacing seems fine. Any thoughts? I know I can work around it if needs be. J ___ Cocoa-dev mailing l

Re: UIDocumentBrowserViewController and file package documents

2017-06-21 Thread Jonathan Hull
That part is really confusing me as well (I am also using a package document). I started by using the documents directory, but I keep getting an error that the browser doesn’t have access. Then I switched to the temp directory, and now it works part of the time, and the other times I still get

Re: Release mode bindings crash and release pools

2017-06-17 Thread Jonathan Mitchell
> On 17 Jun 2017, at 16:36, Charles Srstka wrote: > >> On Jun 17, 2017, at 8:36 AM, Jonathan Mitchell > <mailto:li...@mugginsoft.com>> wrote: > > > Just tested it on 10.9; it works :-) > > import Foundation > > class C: NSObject { >

Re: Release mode bindings crash and release pools

2017-06-17 Thread Jonathan Mitchell
> On 17 Jun 2017, at 14:21, Charles Srstka wrote: > >> On Jun 17, 2017, at 5:32 AM, Jonathan Mitchell > <mailto:li...@mugginsoft.com>> wrote: >> >>> On 16 Jun 2017, at 23:18, Quincey Morris >>> >> <mailto:quinceymor...@rivergat

Re: Release mode bindings crash and release pools

2017-06-17 Thread Jonathan Mitchell
> On 17 Jun 2017, at 01:54, Charles Srstka wrote: > >> it’s preferred that bindings go either through an NSObjectController, an >> NSViewController, or something else that implements NSEditorRegistration. I think that is a crucial aspect in all this. I while back I configured bindings in cont

Re: Release mode bindings crash and release pools

2017-06-17 Thread Jonathan Mitchell
> On 16 Jun 2017, at 23:18, Quincey Morris > wrote: > > On Jun 16, 2017, at 14:41 , Jonathan Mitchell wrote: >> >> I sometimes use the default NSObject bind: to set up a simple one way >> operation as you describe as opposed to a discrete observation. >

Re: Release mode bindings crash and release pools

2017-06-16 Thread Jonathan Mitchell
> On 16 Jun 2017, at 22:32, Quincey Morris > wrote: > > On Jun 16, 2017, at 13:48 , Charles Srstka wrote: >> >> This is incorrect. > > It’s incorrect as a 2-way binding, but it works as a pair of so-called 1-way > bindings, with the proviso that they may need to be unbound manually, to > p

Re: Property in class mirrored to user defaults

2017-06-16 Thread Jonathan Taylor
2 Jun 2017, at 16:01, Charles Srstka wrote: >> On Jun 12, 2017, at 4:04 AM, Jonathan Taylor >> wrote: >> >> Hi all, >> >> This feels like a very basic question, but one that I have not had any luck >> searching for (maybe I am using the wrong terms

Re: Release mode bindings crash and release pools

2017-06-15 Thread Jonathan Mitchell
> On 15 Jun 2017, at 20:03, Quincey Morris > wrote: > > On Jun 15, 2017, at 04:46 , Jonathan Mitchell wrote: >> >> The crash occurs when the pool gets drained. > >> Wrapping my -bind: calls in a release pool solves the issue too. > > The informatio

Release mode bindings crash and release pools

2017-06-15 Thread Jonathan Mitchell
My macOS 10.12 ARC app has a gazillion bindings. Many are made in the NIBS but a lot are dynamically applied in code. In release mode I see the odd crash that can be traced back to NSAutoUnbinder getting dealloc'd in a release pool. With build optimisations set to 0 there is no issue. With build

Property in class mirrored to user defaults

2017-06-12 Thread Jonathan Taylor
Hi all, This feels like a very basic question, but one that I have not had any luck searching for (maybe I am using the wrong terms?). At the moment I have properties in a (singleton) class that are bound to UI elements. At the moment they have the same automatic values every time the app is l

Re: Drawing a 5 Sided Star Shape

2017-06-02 Thread Jonathan Mitchell
> On 2 Jun 2017, at 12:56, Dave wrote: > > Hi, > > I want to draw a 5 sided Star Shape using UIBezierPath. I’ve search for a > general purpose algorithm, but I can’t find anything that I can get to work > with Cocoa/Objective-C. > You could take a peek at https://www.paintcodeapp.com

Re: KVO - deallocation with observers attached

2017-06-02 Thread Jonathan Mitchell
> On 1 Jun 2017, at 00:51, Ken Thomases wrote: > > On May 31, 2017, at 5:02 PM, Jonathan Mitchell wrote: >> >> It is common for deallocating objects to abort if they have observers still >> registered. >> >> The Data_Test object is deallocated w

Re: Relative URLs, and string encodings

2017-06-02 Thread Jonathan Taylor
>> My attempt like: >> [NSURL URLWithString:[path >> stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding] >> relativeToURL:relativeTo]; > > Ah, you want NSUTF8StringEncoding instead. Generally speaking, URL encoding > always uses UTF-8 nowadays. Thankyou for your reply Jens. That's

Relative URLs, and string encodings

2017-06-01 Thread Jonathan Taylor
Can anyone help me with the seemingly simple task of creating a relative NSURL for a filesystem object? The catch here (sorry!) is that I really do need backward compatibility to 10.7, which rules out fileURLWithFileSystemRepresentation:isDirectory:relativeToURL: (which I suspect is the “right”

Re: switching text field between editable and non-editable

2017-05-31 Thread Jonathan Mitchell
> On 31 May 2017, at 21:13, Ken Thomases wrote: > > On May 31, 2017, at 1:51 PM, J.E. Schotsman wrote: >> >> I have a hard time achieving what the message title says. >> Depending on user settings I want a text field to be either editable or >> non-editable. The following works for me. @imp

KVO - deallocation with observers attached

2017-05-31 Thread Jonathan Mitchell
280> ) 2017-05-31 22:49:01.616692+0100 MyApp newObservationInfo : ( Context: 0x10075a4b8, Property: 0x6144abc0> ) 2017-05-31 22:49:04.188226+0100 MyApp Data_Test (0x11336d100) dealloc Thanks Jonathan ___ Cocoa-dev mailing list (

Re: inactive menu item

2017-05-24 Thread Jonathan Mitchell
> On 24 May 2017, at 10:07, J.E. Schotsman wrote: > > Hello, > > I have a popup button with a menu item that I have set disabled in the xib. > Every time the popup is enabled the item is enabled too! > Why isn’t the latent state of the item preserved? > I can solve the problem by binding the en

Re: Context leak detected, msgtracer returned -1 ?

2017-05-22 Thread Jonathan Mitchell
> On 22 May 2017, at 22:24, Greg Parker wrote: > > >> On May 22, 2017, at 8:52 AM, Jonathan Mitchell > <mailto:li...@mugginsoft.com>> wrote: >> >> Context leak detected, msgtracer returned -1 >> > > The context is an IOAccelContext, which i

Context leak detected, msgtracer returned -1 ?

2017-05-22 Thread Jonathan Mitchell
Hi On occasion I see the following in the Xcode console when running my Obj-C app: Context leak detected, msgtracer returned -1 I have tried setting symbolic breakpoints on NSLog etc but to no avail. Is the context in question a CGContext? Thanks J

Re: Times in other cities

2017-05-15 Thread Jonathan Mitchell
You might want to err on the side of caution and ensure that the Calendar object is explicitly set to Gregorian rather than using the current system setting. Jonathan > On 15 May 2017, at 13:50, Eric E. Dolecki wrote: > > Thanks for your reply. Does this look safe to use? >

Re: disable group of controls

2017-04-05 Thread Jonathan Mitchell
> On 5 Apr 2017, at 12:05, J.E. Schotsman wrote: > > >> On 05 Apr 2017, at 11:48, Jack Carbaugh wrote: >> >> Get a list of the controls then loop through it, setting each enabled >> property to false. The container holding them will hold a reference to them > > That way you lose the latent

Re: disable group of controls

2017-04-05 Thread Jonathan Mitchell
> On 5 Apr 2017, at 10:45, J.E. Schotsman wrote: > > >> On 03 Apr 2017, at 21:00, J.E. Schotsman wrote: >> >> What is the Cocoa way of enabling/disabling a group of controls? >> In Carbon I used to use a user pane for that. >> I thought I would try an NSBox but then I realized it is not a cont

Re: Can't use +initialize, now what?

2017-03-30 Thread Jonathan Hull
> On Mar 29, 2017, at 4:24 PM, Charles Srstka wrote: > >> On Mar 29, 2017, at 3:41 PM, Greg Parker wrote: >> >>> On Mar 29, 2017, at 9:02 AM, Charles Srstka >> > wrote: >>> On Mar 29, 2017, at 10:51 AM, Jens Alfke >>> > wrote: >

Re: Printing questions

2017-03-13 Thread Jonathan Mitchell
[printInfo setJobDisposition:NSPrintSaveJob]; // Set the target destination for the file [printInfoDictionary setObject:pdfInfo.URL forKey:NSPrintJobSavingURL]; Jonathan ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post ad

struts and springs layout

2017-03-10 Thread Jonathan Mitchell
In Xcode 8 we can use struts and springs style layout until we add an explicit constraint. The idea seems to be that the strut + spring definition get turned into constraints. However, querying NSView -constraints returns nothing in this case, nor does the debug view hierarchy. Is it just tha

Re: ncurses type wrapper for NStextview

2017-03-06 Thread Jonathan Mitchell
ugh not an NSTextView.. It is normally driven by an XML mapping file but you can call the required methods directly. You can define all the font characteristics etc in the mapping file. https://github.com/ThesaurusSoftware/PDFPageBuilder Search for the following: [self addTextItem:attrString rect:el

Re: Binding NSTextField to an array

2017-03-06 Thread Jonathan Mitchell
Sounds like NSValueTransformer is in fact what you need. It can take in your NSArray ref and spit out a single NSString that the NSTextField binding can live with. Defining NSValueTransformer subclass for every binding can be a pain. So I use a block approach. This has the big advantage that you

Re: Attributed strings - and bounding rects

2017-03-04 Thread Jonathan Mitchell
> I’m still not out of the wood yet though. Sorry. I should have provided more details. What I do to support table cell view wrapping is this. However, I have to support back to 10.9 so it may be possible to use some of the newer auto NSTextField line wrapping stuff. 1. Create a nib containin

Re: Attributed strings - and bounding rects

2017-03-03 Thread Jonathan Mitchell
layout self.usedTextRect = [layoutManager usedRectForTextContainer:textContainer]; Jonathan > On 3 Mar 2017, at 13:28, Igor Ranieri wrote: > > Hi Peter. > > > Have you tried also passing `usesLineFragmentOrigin` as one of the options? > It works here. > > Her

Re: Xcode Framework wrapper for Library ( Exposing library headers)

2017-02-06 Thread Jonathan Mitchell
to be on the beer again: https://lists.apple.com/archives/xcode-users/2014/Apr/msg00079.html <https://lists.apple.com/archives/xcode-users/2014/Apr/msg00079.html> Jonathan > On 6 Feb 2017, at 22:04, Mr steve davis > wrote: > > > I would be so grateful if someone could help

Re: Overriding the release mehod

2017-01-25 Thread Jonathan Hull
One of my favorite things about this list is that the standard response to a question is to ask about the underlying motivation. It shows that they are prepared to think deeply about your problem and don’t want to just give you a cookie cutter answer. One of the main signs of an intelligent pe

Re: Merging scrolling/clipping with NSStackView

2017-01-20 Thread Jonathan Mitchell
> On 20 Jan 2017, at 21:36, Quincey Morris > wrote: > > On Jan 20, 2017, at 02:47 , Jonathan Mitchell <mailto:li...@mugginsoft.com>> wrote: >> >> NSTableView might go something like this: >> >> @implementation TSTableView >> >> - (

Re: Merging scrolling/clipping with NSStackView

2017-01-20 Thread Jonathan Mitchell
> On 19 Jan 2017, at 18:25, Quincey Morris > wrote: > > On Jan 19, 2017, at 06:39 , Daryle Walker wrote: >> >> The inner views should be as tall as they need to be. > > I don’t understand this part. How tall is that? > > I assume you mean that you want the text and table views to be tall en

Re: Merging scrolling/clipping with NSStackView

2017-01-19 Thread Jonathan Mitchell
f.stackViewConstraints = [NSLayoutConstraint constraintsWithVisualFormat:vfl options:0 metrics:nil views:viewsDict]; [scrollView addConstraints:self.stackViewConstraints]; } return scrollView; } @interface TSClipView : NSClipView @end

Re: Cocoa-dev Digest, Vol 13, Issue 518

2017-01-03 Thread Jonathan Prescott
I think that your expectation that presentViewController would retain a strong reference to the view controller is not right. I would put the release after the dismissal code has run. Now, you really don’t need the view controller. Jonathan > On Dec 17, 2016, at 3:00 PM, cocoa-dev-r

NSPredicateEditor query

2016-12-14 Thread Jonathan Mitchell
I have an NSPredicateEditor configured to generate my queries. I have two questions: 1. I want my users to be able to construct queries from a simple initial predicate. Ideally I would like the initial predicate to operate on a single key path and look something like: @"(self.fullName CONTAINS

Re: Using floating point instructions

2016-12-06 Thread Jonathan Mitchell
> On 6 Dec 2016, at 15:27, G 3 wrote: > > Is there a way to fix this problem? > Have you tried lowering the release build optimisation level to match the level used for debug build?. It might get you on the right track. J ___ Cocoa-dev mailing li

Re: Substituting instance of cell subclass for instance of superclass

2016-11-12 Thread Jonathan Mitchell
> On 12 Nov 2016, at 01:34, James Walker wrote: > > However, the new cell has failed to copy much of the state of the old one. > Things like title, font, target, action, bezelStyle... I can manually copy > anything that I notice is missing, but I'm just wondering why the keyed > archiver ap

Re: Programmatically Clear Dirty NSDocument

2016-11-07 Thread Jonathan Mitchell
> On 7 Nov 2016, at 18:46, Richard Charles wrote: > > NSChangeUndone try NSChangeCleared ___ 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-d

Re: Prioritizing drawing of the important stuff

2016-11-01 Thread Jonathan Taylor
Hi everyone, Thankyou all for your replies. Plenty of food for thought there - much appreciated. Looks like timers and flow control is the way forward then, if I want to tackle this. I just thought I'd see if there was anything built in to the standard UI frameworks that might be able to help,

Re: Prioritizing drawing of the important stuff

2016-10-29 Thread Jonathan Taylor
0sec elapsed > time whenever the slider is updated, and if it reaches a small delay then the > HQ image is rendered (and remains on-screen until the slider is later moved > and the process repeats). No need to rely on GCD or threading. > > — Slipp > >> On Oct 29, 20

Re: Prioritizing drawing of the important stuff

2016-10-29 Thread Jonathan Taylor
parency based on its size that might be helpful. > > So, I think I am saying this problem is not new and has been addressed in > several different ways in the NSView class. > > >> On Oct 29, 2016, at 2:37 AM, Jonathan Taylor >> wrote: >> >> Hi all, >>

Prioritizing drawing of the important stuff

2016-10-29 Thread Jonathan Taylor
Hi all, This is a bit of a general question, but hopefully people may have some suggestions. I've got some drawing code that synthesizes an image in a window, which will change in response to sliders (e.g. changing the camera perspective). My problem is how to make it so that the redrawing of t

Re: iOS: Preventing a singleton from being deallocated when the app is in the background.

2016-10-19 Thread Jonathan Mitchell
> On 19 Oct 2016, at 22:14, Jens Alfke wrote: > So that’s not what the problem is. > It may be that the a separate instance of the singleton is getting created via the normal alloc - init sequence outside of the normal singleton accessor. That should be trivial to check for. _

Re: PDFKit on 10.12

2016-10-05 Thread Jonathan Mitchell
> On 5 Oct 2016, at 07:52, Antonio Nunes wrote: > > On 04 Oct 2016, at 14:26, Jonathan Mitchell wrote: >> >> PDFKit seems a bit disturbed on Sierra. >> The 10.12 beta 3 seems to improve things but there are still some rendering >> stutters etc. > > 1

PDFKit on 10.12

2016-10-04 Thread Jonathan Mitchell
(hasInitialNSGraphicsContext) { [NSGraphicsContext restoreGraphicsState]; } else { CGContextRestoreGState(context); } } Jonathan ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list

Re: Mystery Threads

2016-09-30 Thread Jonathan Mitchell
> On 30 Sep 2016, at 10:57, Gerriet M. Denkmann wrote: > > > > But I just cannot see anything which forces my function to run 16 times > longer in the first case. > > Any ideas where to look for a reason? https://github.com/apple/swift-corelibs-libdispatch/blob/ab16f5e62859ff2f54996b8838f83

Re: Stupid objective-c question

2016-09-23 Thread Jonathan Mitchell
> On 23 Sep 2016, at 10:04, Quincey Morris > wrote. > > As previously mentioned, the safest way to do this is: > >> static void* kMyContext = &kMyContext; > Thats a neat trick. It’s not an initialisation that I have seen before and on first glance I thought it was a typo but it works. I norm

Re: Package installation on MacOS Sierra

2016-09-20 Thread Jonathan Mitchell
Sorry. This was a false alarm. It turns out that I was anticipating a new installation into /Applications. However I had a prior installation in username/Downloads so that got updated instead. J > On 18 Sep 2016, at 22:22, Jonathan Mitchell wrote: > > Hi > > I have a Mac

Package installation on MacOS Sierra

2016-09-18 Thread Jonathan Mitchell
Hi I have a MacOS package that installs into /Applications on 10.11. On 10.12 it appears to install into the user’s Downloads folder. Is this change related to the new feature in MacOS 12 to encapsulate downloaded apps into a read only container? Thanks J __

Re: C callbacks with NSNotificationCenter?

2016-09-07 Thread Jonathan Mitchell
. Obj-C methods are C functions that receive self as a parameter. Note that using the CF objects is generally more of a challenge than using NSObject objects. Jonathan ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin req

Re: C callbacks with NSNotificationCenter?

2016-09-07 Thread Jonathan Mitchell
> On 7 Sep 2016, at 17:09, Andreas Falkenhahn wrote: > > > Still, I'm wondering: Is it also possible to have NSNotificationCenter call > a C function for me whenever the notification triggers? Can this somehow > be achieved or am I forced to use full Objective C here? > I would go about this b

Re: Unusual Conditional Formatting

2016-09-07 Thread Jonathan Mitchell
A couple of suggestions. > Here is what I have so far: I used a category on NSNumber to add a > "valueType" attribute as described at > http://nshipster.com/associated-objects/. > > The formatter checks this and the user preference when formatting an incoming > value. It sets some instance va

Re: slicing in Swift

2016-09-06 Thread Jonathan Hull
I realized my comment may not have been clear. Here is the actual code (written in Mail): var numbers: [UInt64] = … func numbers( upTo nbr: Int ) -> [UInt64] { return Array( numbers[ 0 ..< nbr ] ) } Thanks, Jon > On Sep 6, 2016, at 5:42 PM, Jonathan Hu

Re: slicing in Swift

2016-09-06 Thread Jonathan Hull
You can explicitly create an array with the slice by using ‘Array(slice)’. Honestly, I am not sure of the actual value of slices because of issues like this. I would rather have those methods return an Array which is some sort of copy on write slice internally. Thanks, Jon > On Sep 6, 2016,

Re: Dynamic-width Collection View

2016-08-10 Thread Jonathan Hull
;m open to ideas on what I should override in a layout subclass. > Particularly ones that don't require me to reimplement #1 and #2 above. > > Doug Hill > >> On Aug 10, 2016, at 2:16 PM, Jonathan Hull > <mailto:jh...@gbis.com>> wrote: >> >> Because y

Re: Mixed-state checkboxes

2016-07-08 Thread Jonathan Taylor
ing altogether and just set the actual state of the UI element directly from my code. I'd definitely be interested in understanding what it sounded like you were suggesting with a "basically read-only" binding though... Cheers Jonny On 8 Jul 2016, at 18:35, Quincey Morris wro

Mixed-state checkboxes

2016-07-08 Thread Jonathan Taylor
Hi all, I'm trying to work out the correct way to handle a mixed-state checkbox (NSButton checkbox with allowsMixedState=YES), bound to a property on my controller. I am intending it to serve as an "applies to all" type control at the head of a column of checkboxes - so if other checkboxes in t

Re: Emailing from a daemon process

2016-07-07 Thread Jonathan Mitchell
> On 7 Jul 2016, at 17:13, Carl Hoefs wrote: > > I have a daemon app built on Foundation (aka "command line tool") running in > the background and I need it to issue a textual email on certain conditions. > > The solutions for emailing that I've been able to find (NSWorkspace, > NSSharingSer

NSTextView pagination

2016-07-07 Thread Jonathan Mitchell
paginated output. Any ideas? I could supply a new view that would correspond to the new page orientation (if I could get an appropriate notification) but NSPrintOperation’s -view is readonly. Thanks Jonathan ___ Cocoa-dev mailing list (Cocoa-dev

Re: Prioritize my own app's disk access

2016-07-06 Thread Jonathan Taylor
On 6 Jul 2016, at 18:01, Quincey Morris wrote: > On Jul 6, 2016, at 03:06 , Jonathan Taylor > wrote: >> >> a single lost frame will be fairly catastrophic for the scientific experiment > > If this is genuinely your scenario, then nothing mentioned in this thread is

Re: Prioritize my own app's disk access

2016-07-06 Thread Jonathan Taylor
Thanks for your reply Alastair. Definitely interested in thinking about your suggestions - some responses below that will hopefully help clarify: > The first thing to state is that you *can’t* write code of this type with the > attitude that “dropping frames is not an option”. Fundamentally, th

Re: Prioritize my own app's disk access

2016-07-05 Thread Jonathan Taylor
Thanks everyone for your replies on this second question of mine. Some responses below: On 5 Jul 2016, at 18:20, Quincey Morris wrote: > What worries me about the Darwin-level (i.e. Unix-level) API suggestions that > others have made is that you don’t know how these interact with Cocoa apps.

Re: Property synthesis trouble - 32 vs 64 bit builds

2016-07-05 Thread Jonathan Taylor
On 5 Jul 2016, at 22:22, "Gary L. Wade" wrote: > You might need to write some lower level stuff, but some of the things in > there can be done, albeit differently. Apple knows I've submitted a number of > bugs and incident reports to get codecs supported in later frameworks. Do the > same. It m

Re: Property synthesis trouble - 32 vs 64 bit builds

2016-07-05 Thread Jonathan Taylor
>> Quicktime. > > Oh, you poor thing. That’s one nasty API. (Actually dozens of nasty APIs.) O_o Yep. I rely on code that I worked out years ago, with the help of examples on the internet, and I do my best to leave that code untouched! >> My code has been 32-bit only since I first wrote it, bec

Re: Property synthesis trouble - 32 vs 64 bit builds

2016-07-05 Thread Jonathan Taylor
Thanks everyone for your replies - some responses below: On 5 Jul 2016, at 20:55, Greg Parker wrote: > A synthesized property must use one of the following types of storage: > 1. An ivar in that class that @synthesize creates. > 2. An ivar in that class that you defined yourself. > > @synthesize

Re: Property synthesis trouble - 32 vs 64 bit builds

2016-07-05 Thread Jonathan Taylor
that by writing explicit setters/getters, so I will do that. (*) there are rather a lot of these properties in the actual original code, but it just involves a lot of typing! On 5 Jul 2016, at 16:12, Keary Suska wrote: > >> On Jul 5, 2016, at 5:36 AM, Jonathan Taylor >> wrote

Re: Prioritize my own app's disk access

2016-07-05 Thread Jonathan Taylor
Jul 2016, at 13:36, Jonathan Taylor > wrote: >> >> This is a long shot, but I thought I would ask in case an API exists to do >> what I want. One of the roles of my code is to record video to disk as it is >> received from a camera. A magnetic hard disk can normall

Prioritize my own app's disk access

2016-07-05 Thread Jonathan Taylor
This is a long shot, but I thought I would ask in case an API exists to do what I want. One of the roles of my code is to record video to disk as it is received from a camera. A magnetic hard disk can normally keep up with this, but if the user is also doing other things on the computer (e.g. lo

Property synthesis trouble - 32 vs 64 bit builds

2016-07-05 Thread Jonathan Taylor
Hi all, I have a problem with property synthesis in my code, which I hope somebody can advise on. I find I have to write different property synthesis code for 32- or 64-bit builds in order to avoid compiler errors. A minimal demonstration of the problem can be found below - build as part of a

Re: NSArrayController - error inserting object at arranged object index N

2016-06-24 Thread Jonathan Mitchell
> On 23 Jun 2016, at 23:03, Quincey Morris > wrote: > > On Jun 23, 2016, at 13:39 , Jonathan Mitchell <mailto:li...@mugginsoft.com>> wrote: >> >> Do you mean something like this? >> NSMutableArray *proxy = [NSArrayController >> mutableArrayVal

Re: unnamed function586 $$ AMDRadeon X4000GLDriver

2016-06-23 Thread Jonathan Mitchell
> On 23 Jun 2016, at 21:39, Ken Thomases wrote: > > O > > Are there any logs generated from the above call (other than your app's crash > log)? Browse around within Console.app's log list to see. Had a poke around but nothing significant that I can see. > >> CIFilter *colorFilter = [CIFilt

Re: NSArrayController - error inserting object at arranged object index N

2016-06-23 Thread Jonathan Mitchell
> On 23 Jun 2016, at 17:51, Quincey Morris > wrote: > > >> My workaround was to set controller.clearsFilterPredicateOnInsertion == YES >> and reset the filterPredicate following -addObject: >> >> It might be possible to subclass NSArrayController … > > There’s no need to work around at all.

unnamed function586 $$ AMDRadeon X4000GLDriver

2016-06-23 Thread Jonathan Mitchell
On a rare occasion I encounter the following abort while rendering an image in an NSImage category. The method (shown below) gets called frequently to render resources as grayscale. Looks like the driver has issues but beyond that I am stuck. Any ideas? Thread 1 (main-thread) #0 0x7fff9

Re: NSArrayController - error inserting object at arranged object index N

2016-06-23 Thread Jonathan Mitchell
> On 23 Jun 2016, at 14:27, Jonathan Mitchell wrote: > > The following raises with NSInternalInconsistencyException when : > > 1. an NSArrayController filter is in place, > 2. controller.clearsFilterPredicateOnInsertion = NO > 3. added content object is rejected by the

NSArrayController - error inserting object at arranged object index N

2016-06-23 Thread Jonathan Mitchell
The following raises with NSInternalInconsistencyException when : 1. an NSArrayController filter is in place, 2. controller.clearsFilterPredicateOnInsertion = NO 3. added content object is rejected by the filter. Is this behaviour by design? #import “AppDelegate.h" @interface AppDelegate () @

Re: TableView crash with Delegate

2016-06-14 Thread Jonathan Mitchell
> On 14 Jun 2016, at 12:26, Gerriet M. Denkmann wrote: > > > But no problem, as long one keeps in mind (as you recommended) that > awakeFromNib “can get called many times”. > You may be experiencing this, as described in docs for view based table views: NSTableView - (__kindofNSView

Tick marks on scroll bars

2016-06-13 Thread Jonathan Taylor
Hi all, Does anyone know a way of implementing "tick marks" on a scroll bar, in the way that Xcode does to mark code lines where there is an error/warning? From reading header files, I can't see any obvious built-in API to implement this feature, but perhaps somebody knows of a custom class tha

Re: Simplest way to generate audio tones?

2016-05-28 Thread Jonathan Hull
a Programming Guide”, but I can find no such guide and the > mention on the page isn’t a link. > > > —Graham > > > >> On 29 May 2016, at 3:36 PM, Jonathan Hull wrote: >> >> This is way out of my area of expertise, but it appears you want AudioUni

Re: Simplest way to generate audio tones?

2016-05-28 Thread Jonathan Hull
This is way out of my area of expertise, but it appears you want AudioUnits: http://www.cocoawithlove.com/2010/10/ios-tone-generator-introduction-to.html Thanks, Jon > On May 28, 2016, at 8:24 PM, Graham Cox wrote: > > Hi all, > > I’m looking for general pointers to the simplest/quickest way

Re: iOS - the joy of observers and NSInternalInconsistancyException for KVO

2016-05-19 Thread Jonathan Mitchell
> On 19 May 2016, at 17:55, Jonathan Mitchell wrote: > > That way the observed object can get deallocated before the observer. Should say That way the observed object cannot get deallocated before the observer. J ___ Cocoa-dev mailing li

Re: iOS - the joy of observers and NSInternalInconsistancyException for KVO

2016-05-19 Thread Jonathan Mitchell
to remove my observers in NSViewController -dealloc. If you want the observer to stop observing on command then use a delegate pattern or a notification to explicitly request that. It is a futile task IMHO to dig into the KVO machinery and try and se

Re: Set font on NSTextView that uses bindings?

2016-05-19 Thread Jonathan Mitchell
> On 19 May 2016, at 04:47, Rick Mann wrote: > > I seem to be unable to set the font used in an NSTextView that uses bindings > to set the text content. The property it's bound to creates a plain NSString > (no attributes). > > I've tried setting the font, setting the typing attributes, setti

Re: Codesigning pain, god it hurts!

2016-05-18 Thread Jonathan Mitchell
> On 18 May 2016, at 04:29, Quincey Morris > wrote: > > Yes, it’s awful. > I agree. Screwing it up is easy. I use the following project archive scheme post action script to run a Gatekeeper security check on archive builds. This provides decent confirmation that all is well. if [ "${CONFIGU

Re: ARC [was Protecting against "app nap"]

2016-05-12 Thread Jonathan Taylor
, Jens Alfke wrote: > >> On May 11, 2016, at 2:31 AM, Jonathan Taylor >> wrote: >> >> I guess I just found method naming a bit odd (not really referring to an >> object at all), and might have expected it to have an ‘alloc/new’ naming >> since I’d hav

Re: Protecting against "app nap"

2016-05-11 Thread Jonathan Taylor
Thankyou both for your replies - a couple of replies below: On 10 May 2016, at 23:33, Jens Alfke wrote: >> However, I was a bit surprised to find that I seem to need to explicitly >> retain the object I get back [this is non-ARC code…] if I want my request to >> remain in effect or even for the

Protecting against "app nap"

2016-05-10 Thread Jonathan Taylor
Hi all, I’m hoping somebody can help me work out how to protect my code against the effects of “app nap”. This code is driving a scientific experiment, unattended, and it is catastrophic when the OS decides that my timers running at 10Hz should only be fired every 10 seconds or so… which it tur

Re: discontiguous bounds ?

2016-05-09 Thread Jonathan Mitchell
> On 9 May 2016, at 08:59, Graham Cox wrote: > > I’ve done this, based on that code. Yes, it was a bit buggy, but I got it to > work. The app it’s a part of still works when compiled with the latest tools > and SDK. But yes, you need two separate table views to do this. > I have done somethin

  1   2   3   4   5   6   7   8   9   >