Re: i386 Deprecated Warning in Xcode 9.4.1

2019-10-25 Thread Sandor Szatmari via Cocoa-dev
Jens, Thanks for your response, it’s good advice. But, doesn’t get me anywhere unfortunately. See below… > On Oct 24, 2019, at 15:57, Jens Alfke wrote: > >> On Oct 24, 2019, at 11:46 AM, Sandor Szatmari via Cocoa-dev >> wrote: >> >> Is there a fla

i386 Deprecated Warning in Xcode 9.4.1

2019-10-24 Thread Sandor Szatmari via Cocoa-dev
Migrating some code to 64 bit… Making a pit stop at Xcode 9.4.1/32 bit as the last stable 32 bit build. 40+ projects with multiple targets make for a lot of i386 is deprecated noise. I’d like to silence these warnings while I straighten out actual issues. Is there a flag I can set in Xcode

Re: Need for Swift

2019-10-15 Thread Sandor Szatmari via Cocoa-dev
I always felt that swift was introduced to allow the development ecosystem to grow and intended to be a language that eliminated some of the squishiness of Objective-C. My opinion is that this was intended to make Apple’s job of code review and approval easier and more concrete (business

Re: How to check whether directory tree has changed?

2019-12-21 Thread Sandor Szatmari via Cocoa-dev
> On Dec 21, 2019, at 12:56, Gabriel Zachmann wrote: > >  > Thanks a lot! > > Does it really watch subfolders, too? The docs can answer this better I. > > Also, it seems to me like it works only while the program is running. > > I am mostly interested in changes that happen "behind the

Re: How to check whether directory tree has changed?

2019-12-21 Thread Sandor Szatmari via Cocoa-dev
> On Dec 21, 2019, at 13:43, Jens Alfke wrote: > >  > >> On Dec 21, 2019, at 10:18 AM, Gabriel Zachmann via Cocoa-dev >> wrote: >> >> Right. I was hoping there is an easy way to do this. >> Something like a recursive check sum over the whole directory tree that the >> OS might keep. >> I

Re: How to check whether directory tree has changed?

2019-12-21 Thread Sandor Szatmari via Cocoa-dev
I’ve used dispatch stuff. I found this with a quick google… it should be close to what one would need to monitor a folder. int fildes = open("/path/to/directory", O_RDONLY); dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); dispatch_source_t source =

Re: Catalina scroll view issues

2019-12-19 Thread Sandor Szatmari via Cocoa-dev
Eyal, > On Dec 19, 2019, at 02:55, Redler Eyal via Cocoa-dev > wrote: > >  >> >> Since you’re using CoreGraphics, it’s very likely there’s an edge case with >> your customers’ systems that you aren’t encountering. CG is pretty much the >> lowest practical level in the graphics stack.

Re: Sorting an array

2020-02-11 Thread Sandor Szatmari via Cocoa-dev
Gabriel, > On Feb 11, 2020, at 10:36, Gabriel Zachmann via Cocoa-dev > wrote: > > I have some trivial questions regarding sorting a simple array of strings. > > I used to use this code: > >NSSortDescriptor *sd = [[NSSortDescriptor alloc] initWithKey: nil > ascending: YES];//TODO: raus

Re: Confusion about screen resolution

2020-02-22 Thread Sandor Szatmari via Cocoa-dev
> On Feb 22, 2020, at 12:30, Ken Thomases via Cocoa-dev > wrote: > > On Feb 22, 2020, at 9:02 AM, Gabriel Zachmann via Cocoa-dev > wrote: >> >>> >>> No, the default on recent Macs is scaled to slightly under 2x. >>> >> >> It is about ~ 1.7 . >> >> this means that every view has to be

Re: Performance issue on macOS 10.15 obtaining display name for ~/Desktop, ~/Documents, and ~/Downloads

2020-04-24 Thread Sandor Szatmari via Cocoa-dev
Allan, > On Apr 24, 2020, at 00:14, Allan Odgaard via Cocoa-dev > wrote: > > On 24 Apr 2020, at 9:51, Gary L. Wade wrote: > >> Have you tried a speed check with just iCloud turned off but internet on? > > I have tried with iCloud disabled, internet disabled, and SIP disabled. Have you

[OT] Re: NSTimer +timerWithTimeInterval:

2020-04-29 Thread Sandor Szatmari via Cocoa-dev
Alex, > On Apr 29, 2020, at 17:12, Alex Zavatone via Cocoa-dev > wrote: > > Not sure about this, but in Objective-C, you’re not supposed to start > methods with new. I’ve always operated under the premise that using a reserved prefix, such as new, was not verboten. Rather, if one chose

Re: Xcode Build Location

2020-05-08 Thread Sandor Szatmari via Cocoa-dev
Richard, > On May 8, 2020, at 10:16, Steve Mills via Cocoa-dev > wrote: > > On May 8, 2020, at 09:08:17, Richard Charles via Cocoa-dev > wrote: >> >> Some of the dynamically linked libraries are large. If they are put in a >> workspace with the main project then it is so large it becomes

Re: Open a panel in secondary thread?

2020-03-21 Thread Sandor Szatmari via Cocoa-dev
You must run the panel on the main thread. Sandor > On Mar 21, 2020, at 3:05 PM, Gabriel Zachmann via Cocoa-dev > wrote: > > Is it possible to open an NSOpenPanel in a secondary thread? > > I create the thread like this: > >directoryScanThread_ = [[NSThread alloc] initWithTarget:

Re: Open a panel in secondary thread?

2020-03-22 Thread Sandor Szatmari via Cocoa-dev
> On Mar 22, 2020, at 6:20 PM, Steve Mills via Cocoa-dev > wrote: > >  >> >> On Mar 22, 2020, at 15:38, Rob Petrovec via Cocoa-dev >> wrote: >> >> I would not do this. It is widely documented that AppKit API that produce >> UI elements, like NSOpenPanel, are _not_ thread safe. > > The

Re: Open a panel in secondary thread?

2020-03-23 Thread Sandor Szatmari via Cocoa-dev
Gabriel, > On Mar 23, 2020, at 8:54 AM, Gabriel Zachmann via Cocoa-dev > wrote: > > Thanks a lot for your response. > >> I would not do this. It is widely documented that AppKit API that produce >> UI elements, like NSOpenPanel, are _not_ thread safe. > > Right, and that is why I have

Re: Open a panel in secondary thread?

2020-03-23 Thread Sandor Szatmari via Cocoa-dev
> On Mar 23, 2020, at 10:01 AM, Gabriel Zachmann wrote: > >  I would not do this. It is widely documented that AppKit API that produce UI elements, like NSOpenPanel, are _not_ thread safe. >>> >>> Right, and that is why I have to execute any UI code in the main thread, >>> or so

Re: Concurrent loading of images ?

2020-05-08 Thread Sandor Szatmari via Cocoa-dev
> On May 8, 2020, at 15:13, Rob Petrovec via Cocoa-dev > wrote: > >  > >>> On May 8, 2020, at 12:19 PM, Jens Alfke via Cocoa-dev >>> wrote: >>> >>> >>> On May 8, 2020, at 9:53 AM, Gabriel Zachmann via Cocoa-dev wrote: >>> >>> So, I was thinking, maybe it helps to load the

Re: How to save a window's position and size

2020-05-23 Thread Sandor Szatmari via Cocoa-dev
Gabriel, > On May 23, 2020, at 15:54, Gabriel Zachmann via Cocoa-dev > wrote: > > Actually, after observing the new behavior for a while, > I have to say it's "almost" perfect. > > The window still opens at some funny position with a smallish size (where is > that stored?), > but with no

Re: Xcode Archive builds Debug version?

2020-05-24 Thread Sandor Szatmari via Cocoa-dev
Gabriele, When you do archive Xcode uses a different build destination. It seems to use /Library/Developer/Xcode/Archives It builds an Archive bundle of sorts to package your build. You can right click in the organizer and select ‘Show In Finder’ and explore what Xcode is building for you.

Re: Screensaver can capture mouse events under Catalina

2020-05-26 Thread Sandor Szatmari via Cocoa-dev
Gabriel, > On May 26, 2020, at 04:21, Gabriel Zachmann wrote: > > Thanks a lot for your response! > > Unfortunately, with -addGlobalMonitorForEventsMatchingMask: , > the event is still passed on to the higher-up objects, so that makes the > screensaver engine terminate the screensaver

Re: Screensaver can capture mouse events under Catalina

2020-05-25 Thread Sandor Szatmari via Cocoa-dev
Gabriel, (this is a dup reply, forgot to cc list) How are you setting up you global event monitor? I use this to handle catching mouse moved event when my app is not in the foreground…. maybe you use something like this Just watch out for a lot of events and making your app a CPU hog.

Re: Drag-and-drop onto an NSTextField?

2020-08-01 Thread Sandor Szatmari via Cocoa-dev
> object the first responder. Never invoke this method directly. > > > > > —Graham > > > >> On 1 Aug 2020, at 10:16 am, Sandor Szatmari via Cocoa-dev >> wrote: >> >> I call… >> >>

Re: Drag-and-drop onto an NSTextField?

2020-08-01 Thread Sandor Szatmari via Cocoa-dev
r DOES refuse, but that’s what they tell you to do (from >> the documentation on [NSReponder becomeFirstResponder]: >> >>> Use the NSWindow makeFirstResponder: method, not this method, to make an >>> object the first responder. Never invoke this method directly

Re: Drag-and-drop onto an NSTextField?

2020-07-31 Thread Sandor Szatmari via Cocoa-dev
Carl, >> On Jul 31, 2020, at 20:07, Carl Hoefs wrote: > Hmm, subleasing NSTextField doesn't work for me (the dragged item gets > rejected). I've got the protocol in my subclass of > NSTextField. > > Is there something I need to set in -draggingEntered:? I call… [self becomeFirstResponder]

Re: Drag-and-drop onto an NSTextField?

2020-07-31 Thread Sandor Szatmari via Cocoa-dev
For NSTexrField I have always created a subclass for my textfields I call -registerForDraggedTypes: in -awakeFromNib in the subclass And then to accept the drag implement the method in the sublclass -(NSDragOperation)draggingEntered:(id)sender If there’s an easier or better it’d be cool to

Re: Drag-and-drop onto an NSTextField?

2020-07-31 Thread Sandor Szatmari via Cocoa-dev
Took a bit to originally figure out but seems to me like it should be a default, or at least easily selectable behavior with an API. Sandor > On Jul 31, 2020, at 20:17, Carl Hoefs wrote: > > Sandor, > > Ah! That's quite clever... and it works, too! > > Thanks! > -Carl > > >> On Jul 31,

Re: Launching in fullscreen gives "Funk" sound sometimes

2020-06-24 Thread Sandor Szatmari via Cocoa-dev
G, > On Jun 24, 2020, at 12:57, Gabriel Zachmann via Cocoa-dev > wrote: > >  >> >> >> Set a symbolic breakpoint on NSBeep and see whether it’s your code that’s >> calling it. >> > > Thanks, but how would I do that? > I never use NSBeep in my code .. The system is calling NSBeep > >

Re: Prevent screen saver from starting, but don't prevent computer sleep

2020-06-29 Thread Sandor Szatmari via Cocoa-dev
> On Jun 28, 2020, at 22:29, じょいすじょん via Cocoa-dev > wrote: > > One way to do this is with the command line tool: > caffeinate > > You could run a background task that starts it with something like > caffeinate -dimsu > > You can probably also find its source code on opensource.apple.com

Re: Prevent screen saver from starting, but don't prevent computer sleep

2020-06-29 Thread Sandor Szatmari via Cocoa-dev
> On Jun 29, 2020, at 02:46, じょいすじょん wrote: > >  > >>> On Jun 29, 2020, at 15:24, Sandor Szatmari >>> wrote: >>> >>> >>> On Jun 28, 2020, at 22:29, じょいすじょん via Cocoa-dev wrote: >>> >>> One way to do this is with the command line tool: >>> caffeinate >>> >>> You could run

Re: Prevent screen saver from starting, but don't prevent computer sleep

2020-06-29 Thread Sandor Szatmari via Cocoa-dev
Gabriel, > On Jun 29, 2020, at 07:04, Gabriel Zachmann wrote: > >  >> I was hoping to convey to the OP that the goals of this question might have >> unintended consequences. > > > I realize there might be security concerns with what I am trying to do. > > Is there a way to lock the screen

Re: Prevent screen saver from starting, but don't prevent computer sleep

2020-06-27 Thread Sandor Szatmari via Cocoa-dev
G, > On Jun 27, 2020, at 12:47, Gabriel Zachmann via Cocoa-dev > wrote: > > Does anyone know how to programmatically disable macOS from launching the > screen saver on macOS? > I would like to do that in one of my apps. Not sure in general, but in a managed host situation this type of

Re: Prevent screen saver from starting, but don't prevent computer sleep

2020-06-28 Thread Sandor Szatmari via Cocoa-dev
G, > On Jun 28, 2020, at 15:31, Gabriel Zachmann wrote: > >  >>> Does anyone know how to programmatically disable macOS from launching the >>> screen saver on macOS? >>> I would like to do that in one of my apps. >> >> Not sure in general, but in a managed host situation this type of system

Re: How do you handle reading a plist if it may be an array or a dictionary?

2021-05-09 Thread Sandor Szatmari via Cocoa-dev
Alex, > On May 9, 2021, at 15:15, Steve Mykytyn via Cocoa-dev > wrote: > > You're creating your own problem here. Agreed, If you have control. I would either make all top level objects arrays, or dictionaries. If your writing the plist and its a dict, wrap it in an array, or vice versa,

Re: Several different NSUserDefaults in the same app?

2021-04-02 Thread Sandor Szatmari via Cocoa-dev
Would suites work for you? From the NSUserDefaults docs… Maintaining Suites - addSuiteNamed: Inserts the specified domain name into the receiver’s search list. - removeSuiteNamed: Removes the specified domain name from the receiver’s search list. Sandor Szatmari > On Apr 2, 2021, at 17:05,

Re: Several different NSUserDefaults in the same app?

2021-04-03 Thread Sandor Szatmari via Cocoa-dev
Gabriel, > On Apr 3, 2021, at 07:41, Gabriel Zachmann via Cocoa-dev > wrote: > > Thanks a lot for your response! > >> User Defaults are now stored in an opaque in memory DB, and while the >> various files may still play a role, you can't make any assumptions about >> them anymore. > >

Re: Several different NSUserDefaults in the same app?

2021-04-03 Thread Sandor Szatmari via Cocoa-dev
Gabriel > On Apr 3, 2021, at 10:55, Gabriel Zachmann wrote: > >  >> >>> >>> [ [NSUserDefaults userDefaultsWithName:@"monitor-name"] boolForKey:@"some >>> key"] >> >> I thought -addSuiteNamed: would allow you to maintain/add a suite of >> defaults for each monitor. > > Maybe. > > The

Re: Building for 10.12

2022-03-20 Thread Sandor Szatmari via Cocoa-dev
G > On Mar 20, 2022, at 17:04, Gabriel Zachmann via Cocoa-dev > wrote: > >  >> >>> My question now is: why did Xcode not warn me about that function, even >>> though the deployment target was set to 10.12 ? >>The deployment target not a compiler setting. It is more of a runtime >>

Re: Avoiding leaks with "initWithCGImage"

2023-08-23 Thread Sandor Szatmari via Cocoa-dev
You mention ARC… aren’t you not supposed to explicitly release objects under ARC? Am I misunderstanding? Sandor > On Aug 23, 2023, at 18:48, JPH via Cocoa-dev > wrote: > > Hello friends, > > The enclosed procedure is producing a NSImage from another NSImage, by > cropping in a NSRect. >

Re: Mystery interference with AirPlay

2022-06-15 Thread Sandor Szatmari via Cocoa-dev
> > On Jun 15, 2022, at 12:56, Gabriel Zachmann via Cocoa-dev > wrote: > > I am using only: > > o NSBeep() > o NSSound > 0 and link to these frameworks: CoreLocation, Foundation, Cocoa, ScreenSaver, > QuartzCore, ApplicationServices, AppKit, Photos, MediaLibrary, IOKit > > Does any of

Re: Set focus on NSTextField in an NSMenuItem

2022-10-19 Thread Sandor Szatmari via Cocoa-dev
Dragan, > On Oct 19, 2022, at 15:46, Dragan Milić via Cocoa-dev > wrote: > >  >> >> On 19. 10. 2022., at 03:52, Eric Schlegel wrote: >> >> >> I can tell you that the Help menu does itself use makeFirstResponder: on the >> text view… > > Eric, thanks for detailed explanation and

Re: Set focus on NSTextField in an NSMenuItem

2022-10-21 Thread Sandor Szatmari via Cocoa-dev
Drgan, > > On Oct 21, 2022, at 05:37, Dragan Milić via Cocoa-dev > wrote: > >  >> On 20. 10. 2022., at 01:22, Sandor Szatmari wrote: >> I have a status item and in order to get it to show I have to call this in >> my code that orders in the view/window >> [[NSApplication sharedApplication]

Re: Set focus on NSTextField in an NSMenuItem

2022-10-22 Thread Sandor Szatmari via Cocoa-dev
Status items used to be easy… sigh Sandor > On Oct 22, 2022, at 09:37, Richard Charles wrote: > >  >> On Oct 21, 2022, at 8:32 PM, Richard wrote: >> >> In Xcode 13 the Info.plist file is now created automatically using build >> settings. Set "Application is Agent (UIElement)" to Yes.

Re: Set focus on NSTextField in an NSMenuItem

2022-10-21 Thread Sandor Szatmari via Cocoa-dev
On Oct 21, 2022, at 6:57 AM, Sandor Szatmari via Cocoa-dev >> wrote: >> >> Understood. I DON’t get the behavior your seeing where the menu closes. >> Perhaps because I’m calling it from a different point in code. I am calling >> [NSApplication activateI

Re: dictionaryWithObjects:keys: looses elements

2023-01-04 Thread Sandor Szatmari via Cocoa-dev
Did you dump the arrays to the console to verify uniqueness of your keys? Can you show that output here? Sandor > On Jan 3, 2023, at 17:53, Gabriel Zachmann via Cocoa-dev > wrote: > > I have this line in my code: > >NSDictionary * temp = [NSDictionary dictionaryWithObjects: imagefiles_

Re: How to convert path through container into standard form?

2022-12-11 Thread Sandor Szatmari via Cocoa-dev
-stringByAbbreviatingWithTildeInPath First page in google results > On Dec 11, 2022, at 15:06, Gabriel Zachmann via Cocoa-dev > wrote: > >  > I have an NSURL * pictures_path; > > By default, this is set to > > pictures_path = [ [NSFileManager defaultManager] URLForDirectory: >

Re: How to convert path through container into standard form?

2022-12-11 Thread Sandor Szatmari via Cocoa-dev
Looking back, I guess you’d bump up against the sandbox with this… > > On Dec 11, 2022, at 16:21, Sandor Szatmari > wrote: > > -stringByAbbreviatingWithTildeInPath > > First page in google results > >> On Dec 11, 2022, at 15:06, Gabriel Zachmann via Cocoa-dev >> wrote: >> >>  >> I

Re: How to convert path through container into standard form?

2022-12-11 Thread Sandor Szatmari via Cocoa-dev
I was thinking that’d break sandbox encapsulation. But I guess what really matters is what you get when you do the reverse and expand the tilde? > > On Dec 11, 2022, at 17:58, Ben Kennedy via Cocoa-dev > wrote: > >  > >> On 11 Dec 2022, at 12:51 pm, Mike Abdullah via Cocoa-dev >> wrote:

Re: Auto-layout, Forcing a top-level view to hug its contents

2022-11-04 Thread Sandor Szatmari via Cocoa-dev
> On Nov 4, 2022, at 23:05, Steve Christensen via Cocoa-dev > wrote: > > The view hierarchy doesn’t go through a layout pass until after it is added > to a live view or window. At awakeFromNib time it’s still essentially a > snapshot of the layout in the nib since it hasn’t yet been