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.
>
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_
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:
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
-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:
>
> 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
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.
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
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]
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
>
> 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
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
>>
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,
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
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.
>
>
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,
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
> 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…
>>
>>
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,
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]
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
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
> 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
> 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
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
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
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
>
>
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
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.
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.
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
> 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
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
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
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
> 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
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
> 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
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:
> 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
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
> 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
> 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
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 =
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.
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
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
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
48 matches
Mail list logo