Re: Accessibility Settings

2024-01-11 Thread Keary Suska via Cocoa-dev
I don’t have those settings on my Mac (Monterey) so I can’t check but I wonder 
if you can simply query existing controls for their font information?

HTH,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business”



> On Jan 11, 2024, at 8:50 AM, Alex Zavatone via Cocoa-dev 
>  wrote:
> 
> I’m sure there is an easier way to do this but well, I don’t know what it is.
> 
> In the System Settings: Accessibility: Display: Text, I set my font size to 
> 13.
> 
> There is a database is located at /Library/Application 
> Support/com.apple.TCC/TCC.db . To query the database from the command line, 
> use sqlite3 or an SQL browser (I used DB Browser).
> 
> The modification date of that file does not reflect that it was just modified 
> and there is no 13 in it. (I copied the file to another directory to view)
> 
> In the file in the access table, I found entries for many of the app bundle 
> identifiers, but nothing for text and nothing with a 13 in it.
> 
> Ideally I’d search the entire drive for a mod date of today and locate that 
> file, but I’ll leave that up to you.
> 
> Good luck.  Let us know what you find.
> 
> Cheers,
> Alex Zavatone
> 
> 
> 
>> On Jan 11, 2024, at 10:58 AM, Alex Zavatone via Cocoa-dev 
>>  wrote:
>> 
>> I had to do something like that on iOS a few years back.  Let me see if I 
>> have a solution for MacOS.
>> 
>> Cheers, 
>> Alex Zavatone
>> 
>>> On Jan 10, 2024, at 10:48 AM, Tom Doan via Cocoa-dev 
>>>  wrote:
>>> 
>>> I'm trying to figure out how to query the value for the 
>>> Accessibility---Display---Text Size for MacOS (Objective-C). I can't 
>>> for the life of me find any documentation on it, and anything that 
>>> looks even close appears to be for iOS and Swift. Can anyone point 
>>> me in the right direction?
>>> 
>>> Best regards,
>>> 
>>> Tom Doan
>>> ---
>>> Estima
>>> 2717 Harrison St
>>> Evanston, IL 60201
>>> USA
>>> 
>>> 
>>> ___
>>> 
>>> 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 Subscription:
>>> https://lists.apple.com/mailman/options/cocoa-dev/zav%40mac.com
>>> 
>>> This email sent to z...@mac.com
>> 
>> ___
>> 
>> 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 Subscription:
>> https://lists.apple.com/mailman/options/cocoa-dev/zav%40mac.com
>> 
>> This email sent to z...@mac.com
> 
> ___
> 
> 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 Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/cocoa-dev%40esoteritech.com
> 
> This email sent to cocoa-...@esoteritech.com

___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Mystery interference with AirPlay

2022-06-15 Thread Keary Suska via Cocoa-dev
A more useful response may be that you may already have devices that support 
AirPlay. By any chance have you checked to see if any devices show under the 
AirPlay menu in the Music desktop app? Note that Mac computers can AirPlay to 
each other. Many smart TV’s support AirPlay, as do most modern Internet-enabled 
receivers. Also note that devices might need to be turned on to be found.

HTH,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"

> On Jun 15, 2022, at 7:26 AM, Steven Mills via Cocoa-dev 
>  wrote:
> 
> On Jun 15, 2022, at 03:44:41, Gabriel Zachmann via Cocoa-dev 
>  wrote:
> 
>> Making matters worse, I don't have AirPlay.
> 
> Everybody has Airplay. It's a feature, not a thing.
> 
> --
> Steve Mills
> Drummer, Mac geek
> 
> ___
> 
> 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 Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/cocoa-dev%40esoteritech.com
> 
> This email sent to cocoa-...@esoteritech.com

___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Problem with rangeOfString and Umlauts

2022-03-11 Thread Keary Suska via Cocoa-dev
NSRange is 0-based, so the 16th character is index 15. Also you might want to 
use -localizedStandardRangeOfString: instead...

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business”



> On Mar 11, 2022, at 9:10 AM, Jack Brindle via Cocoa-dev 
>  wrote:
> 
> I just placed your code into a short tool in Xcode. What I get is interesting:
> 
> prefix_lenunsigned int15
> 
> Which his as you say. But:
> 
> space_in_filename NSRange location=15, length=1   
> 
> Which is not the same as you say. This is in Xcode 13.2.1. Is something else 
> going on?
> 
> For the record, the body of main contains:
> 
>   @autoreleasepool {
> 
>   NSString *file_basename = @"Morgendämmerung (1)";
>   NSString *info_item = @"Morgendämmerung";
> 
>   NSString * prefix = [info_item commonPrefixWithString: 
> file_basename options: NSCaseInsensitiveSearch ];
>   unsigned int prefix_len = (unsigned int) [prefix length];
> 
>   NSRange space_in_filename = [file_basename rangeOfString: @" " 
> options: 
> NSDiacriticInsensitiveSearch|NSCaseInsensitiveSearch|NSWidthInsensitiveSearch];
> 
>   NSLog(@"Break heere");
>   }
> 
> So what is different?
> 
> Jack
> 
> 
>> On Mar 11, 2022, at 11:17 AM, Gabriel Zachmann via Cocoa-dev 
>>  wrote:
>> 
>> 
>> Well, SSIA.
>> In more detail, I've got two strings:
>> 
>> file_basename = @"Morgendämmerung (1)"
>> info_item = @"Morgendämmerung"
>> 
>> This code
>> 
>>   NSString * prefix = [ info_item commonPrefixWithString: file_basename 
>> options: NSCaseInsensitiveSearch ];
>>   unsigned int prefix_len = (unsigned int) [prefix length];
>> 
>> yields prefix_len = 15
>> as it should.
>> 
>> The problem arises with this line of code:
>> 
>>   NSRange space_in_filename = [file_basename rangeOfString: @" " options: 
>> NSDiacriticInsensitiveSearch|NSCaseInsensitiveSearch|NSWidthInsensitiveSearch];
>> 
>> which yields space_in_filename.location = 16 !
>> 
>> This thwarts the rest of the code, which, in this case, would expect 
>> space_in_filename.location = 15.
>> 
>> Needless to say that with strings that do not contain Umlauts, the call of 
>> rangeOfString:options: works as expected, i.e., in the above example 
>> space_in_filename.location is as expected (i.e., first character has 
>> location=0).
>> 
>> I have also tried localizedStandardRangeOfString, with the same effect.
>> 
>> Any ideas what I can do?
>> 
>> 
>> Best regards, Gabriel
>> 
>> 
>> ___
>> 
>> 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 Subscription:
>> https://lists.apple.com/mailman/options/cocoa-dev/jackbrindle%40me.com
>> 
>> This email sent to jackbrin...@me.com
> 
> ___
> 
> 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 Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/cocoa-dev%40esoteritech.com
> 
> This email sent to cocoa-...@esoteritech.com

___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Indexing broken for one project

2022-02-06 Thread Keary Suska via Cocoa-dev
I have come across issues where a code syntax error messes up indexing—are you 
able to do a full, successful compilation? Other than that, I have heard that 
some issues might require a system restart, i.e. 1) quitting Xcode; 2) deleting 
derived data (if you use a shared location you might also want to delete or 
move derived data from other projects); and 3) restarting the computer.

HTH,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business”



> On Feb 6, 2022, at 9:32 AM, Gabriel Zachmann via Cocoa-dev 
>  wrote:
> 
> Thanks a lot for your response.
> 
> I had tried that already, to no avail.
> 
> I am seeing lots of   "Crash detected during compilation"
> in Xcode's indexing log.
> 
> Best regards, Gabriel
> 
> 
> 
>> On 6. Feb 2022, at 19:18, Rob Petrovec  wrote:
>> 
>> Quit Xcode, delete the DerivedData directory for your project and re-open 
>> your project.  That should trigger a re-index and a full rebuild of your 
>> product.
>> 
>> The default location for the DerivedData directory is in 
>> ~/Library/Developer/Xcode/DerivedData/-> letters>.  You can also configure it to be in your source directory, like I 
>> do, so you can keep your build products with your code.
>> 
>> Hope that helps.
>> 
>> —Rob
>> 
>> 
>>> On Feb 6, 2022, at 6:20 AM, Gabriel Zachmann via Cocoa-dev 
>>>  wrote:
>>> 
>>> A few weeks ago, indexing in Xcode 13 stopped working for one of my 
>>> projects.
>>> So, for instance, "Jump to Definition" does not work any more.
>>> I don't know what stopped indexing to work.
>>> 
>>> The project consists of objective-c source code.
>>> For other projects, indexing still works fine.
>>> 
>>> I have tried to delete Derived Data (which, in my case, is stored under 
>>> /tmp).
>>> I have also tried to follow these instructions 
>>> https://levelup.gitconnected.com/uncovering-xcode-indexing-8b3f3ff82551
>>> and perused the log file, but I could not see any error messages.
>>> 
>>> Any ideas what else I can try?
>>> Could it be something in the source code / header files?
>>> (The project compiles just fine, though.)
>>> 
>>> Best regards, Gabriel
>>> 
>>> ___
>>> 
>>> 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 Subscription:
>>> https://lists.apple.com/mailman/options/cocoa-dev/petrock%40mac.com
>>> 
>>> This email sent to petr...@mac.com
>> 
> 
> ___
> 
> 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 Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/cocoa-dev%40esoteritech.com
> 
> This email sent to cocoa-...@esoteritech.com

___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Intermittent invisible NSWindow

2021-11-15 Thread Keary Suska via Cocoa-dev
I can say it has been true in the past, even if it is no longer the case. It is 
not something I test with each OS release. I certainly can move a window almost 
entirely offscreen—enough to not notice it at least. Also, your suggestion that 
the window may have an invalid size could also be the case, additionally 
revealed by logging the window frame. I have seen some auto layout wonkiness 
that forces  too-small frame, though not enough to  make it disappear. 

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business”



> On Nov 15, 2021, at 7:13 AM, Tom Doan via Cocoa-dev 
>  wrote:
> 
> Thanks, but is that true? I've tried forcing the window off screen with 
> setFrame: and it still shows up (generally pinned to the top of the 
> visible frame) even though the [NSWindow frame] returns the 
> "off-screen" location that I programmed in. The only way I have 
> found to make the window "invisible" is to give it a non-positive size, 
> and then pulling it off the window menu still won't show it.
> 
>> Have you logged the window coordinates? It might be placed fully
>> offscreen, and that would produce the behavior you are seeing.
>> 
>> Keary Suska
>> Esoteritech, Inc.
>> "Demystifying technology for your home or business"
>> 
>> 
>> 
>>> On Nov 13, 2021, at 9:52 AM, Tom Doan via Cocoa-dev
>>>  wrote:
>>> 
>>> I'm having a problem with an application where a small percentage of
>>> users have one particular NSWindow type which doesn't show even
>>> though it goes through a makeKeyAndOrderFront. It's on the window
>>> list and will open if they do a tile, cascade or window switch
>>> operation, but doesn't come up initially. I can't reproduce this on
>>> any of my computers running three different flavors of MacOS
>>> (including Big Sur and Monterey). What should I be looking for that
>>> might cause this behavior.
>>> 
>>> Best regards,
>>> 
>>> Tom Doan
>>> ---
>>> 2717 Harrison St
>>> Evanston, IL 60201
>>> USA
>>> 
>>> 
>>> ___
>>> 
>>> 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 Subscription:
>>> https://lists.apple.com/mailman/options/cocoa-dev/cocoa-dev%40esoter
>>> itech.com
>>> 
>>> This email sent to cocoa-...@esoteritech.com
>> 
> 
> 
> ---
> 2717 Harrison St
> Evanston, IL 60201
> USA
> 
> 
> ___
> 
> 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 Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/cocoa-dev%40esoteritech.com
> 
> This email sent to cocoa-...@esoteritech.com

___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Intermittent invisible NSWindow

2021-11-13 Thread Keary Suska via Cocoa-dev
Have you logged the window coordinates? It might be placed fully offscreen, and 
that would produce the behavior you are seeing.

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business”



> On Nov 13, 2021, at 9:52 AM, Tom Doan via Cocoa-dev 
>  wrote:
> 
> I'm having a problem with an application where a small percentage 
> of users have one particular NSWindow type which doesn't show 
> even though it goes through a makeKeyAndOrderFront. It's on the 
> window list and will open if they do a tile, cascade or window switch 
> operation, but doesn't come up initially. I can't reproduce this on any 
> of my computers running three different flavors of MacOS (including 
> Big Sur and Monterey). What should I be looking for that might 
> cause this behavior.
> 
> Best regards,
> 
> Tom Doan
> ---
> 2717 Harrison St
> Evanston, IL 60201
> USA
> 
> 
> ___
> 
> 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 Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/cocoa-dev%40esoteritech.com
> 
> This email sent to cocoa-...@esoteritech.com

___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Accessing a property of a view via its controller doesn't work

2021-09-04 Thread Keary Suska via Cocoa-dev
Perhaps a more germane question might be, are you sure that the view controller 
has a relationship with any window? It is not necessary, as I understand, for a 
view to exist in a window. A view controller can load a view without placing it 
into a window, and therefore viewWillMoveToWindow: will not be called, and I 
suspect the “window” property would be set. Breakpoints are your friend.

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"

> On Sep 4, 2021, at 12:06 PM, Ben Kennedy via Cocoa-dev 
>  wrote:
> 
> 
>> On Sep 4, 2021, at 10:27 AM, Gabriel Zachmann via Cocoa-dev 
>>  wrote:
>> 
>> I access the window of a view by two different ways, in the controller and 
>> in the view, resp., and in the controller, I always get a nil pointer.
>> 
>> In my app, I have a subclass of NSView, MyView, declared like this:
>> 
>> @interface MyView : NSView > CAAnimationDelegate>
>> {
>>   NSWindow * window_;
>>   ...
>> }
>> @property (readwrite) NSWindow * window_;
> 
> What’s the purpose of this? NSView already has a `window` property that 
> returns its parent window. Why not just use that?
> 
> -ben
> 
> Sent from my iPhone
> ___
> 
> 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 Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/cocoa-dev%40esoteritech.com
> 
> This email sent to cocoa-...@esoteritech.com

___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Special question about NSOpenPanel

2021-05-24 Thread Keary Suska via Cocoa-dev
I don’t know if this helps but I have noticed issues under Catalina where with 
various applications that the save panel simply and inexplicably fails to open. 
I haven’t thought to see if the open panel was not working either but since 
it’s a subclass the issues could be related. There doesn’t seem to be any rhyme 
or reason and it happens just as much if not more with Apple apps (Safari & 
Preview especially) as well as others. I suspect a bug in the OS.

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"

> On May 24, 2021, at 12:55 PM, Gabriel Zachmann via Cocoa-dev 
>  wrote:
> 
> I have a special situation where NSOpenPanel does not open a panel.
> 
> The circumstances:
> My app is actually a screensaver, so it's run inside legacyScreenSaver.
> Also, it seems to occur only under macOS 10.15.0, and (perhaps) only for some 
> users, not all.
> 
> What happens is that [oPanel runModal] does not open the panel, but I know 
> from the messages my screensaver saves in the log that it does get executed.
> Instead, it seems to return directly/immediately with return code 
> NSModalResponseCancel.
> 
> Below is the relevant source code.
> 
> Question: does anyone have an idea what might be causing this strange 
> behavior?
> 
> (It goes without saying that on my system everything runs fine, both on macOS 
> 10.15.4 and macOS 11.3.1.)
> 
> Thanks a lot in advance.
> 
> Best regards, Gab.
> 
> 
> Source code:
> 
>NSOpenPanel *oPanel = [NSOpenPanel openPanel];
>[oPanel setAllowsMultipleSelection: NO];
>[oPanel setCanChooseDirectories: YES];
>[oPanel setCanChooseFiles: NO];
>long int result = [oPanel runModal];
>new_url = oPanel.URL;
> 
> 
> ___
> 
> 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 Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/cocoa-dev%40esoteritech.com
> 
> This email sent to cocoa-...@esoteritech.com

___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: MacOS: nonmodal NSAlert panel

2021-05-12 Thread Keary Suska via Cocoa-dev
I believe Apple uses NSPopOver for non-modal alerts and dialogs, which can 
automatically dismiss when the user clicks outside the popover.

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"

> On May 12, 2021, at 12:17 PM, Carl Hoefs via Cocoa-dev 
>  wrote:
> 
> I had thought it was possible on MacOS to run an NSAlert panel nonmodally...
> 
> I'd like to present an informational alert for n seconds then dismiss it 
> without user interaction. But I don't see any way to dismiss, terminate, 
> cancel, invalidate, etc. an NSAlert object.
> 
> I know this is possible in iOS, but is there no way to do this in MacOS, 
> other than displaying/hiding an NSPanel of my own?
> 
> -Carl
> 
> ___
> 
> 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 Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/cocoa-dev%40esoteritech.com
> 
> This email sent to cocoa-...@esoteritech.com

___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: fileManagerWithAuthorization:

2021-03-15 Thread Keary Suska via Cocoa-dev
That forum thread does not, as far as I can tell, say that you need a 
provisioning profile for non-sandboxed apps. In fact, the final recommendation 
is to turn off sandboxing to test privileged operations without the need for 
entitlements.

However, it appears an app must still be notarized 
(https://developer.apple.com/news/?id=09032019a) and may need user granted 
permission to access certain areas.

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"

> On Mar 15, 2021, at 12:44 AM, Allan Odgaard via Cocoa-dev 
>  wrote:
> 
> On 14 Mar 2021, at 19:44, Michael Tsai wrote:
> 
>> I think you need to apply to Apple and get a provisioning profile, even if 
>> the app isn't sandboxed:
>> 
>> https://developer.apple.com/forums/thread/653890
> 
> Thanks, what a disappointing policy decision by Apple. Especially when they 
> are trying to get rid of most other privileged file operation API.
___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Programmatically created NSButton is drawn in the wrong position.

2020-12-15 Thread Keary Suska via Cocoa-dev
Based on what you are doing, setting the property to YES will get you closer to 
what your problem is. When this property is NO, you cannot accurately control 
the view’s frame.

That being said, when are you verifying that the frame of the buttons is 
unchanged?

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"

> On Dec 15, 2020, at 3:49 AM, Eyal Redler via Cocoa-dev 
>  wrote:
> 
> setting translatesAutoresizingMaskIntoConstraints to yes makes the situation 
> worse. The buttons are drawn further away than their frames indicate.
> 
> Eyal
> 
>> On 15 Dec 2020, at 4:05, Ben Kennedy  wrote:
>> 
>> 
>>> On 14 Dec 2020, at 5:39 pm, Eyal Redler via Cocoa-dev 
>>>  wrote:
>>> 
>>> button = [[NSButton alloc] initWithFrame:NSMakeRect(0, 0, 0, 0)];
>>> [button setTranslatesAutoresizingMaskIntoConstraints:NO];
>>> [button setBezelStyle:NSRoundedBezelStyle];
>>> [button setTitle:buttonTitle];
>>> [button sizeToFit];
>>> [button setFrameOrigin:NSMakePoint(position, 20)];
>> 
>> Since you're positioning the frames manually, you need to set 
>> setTranslatesAutoresizingMaskIntoConstraints = YES instead of NO.
>> 
>> -ben
>> 
> 
> ___
> 
> 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 Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/cocoa-dev%40esoteritech.com
> 
> This email sent to cocoa-...@esoteritech.com

___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSTimer +timerWithTimeInterval:

2020-04-29 Thread Keary Suska via Cocoa-dev
Are the timer values actual numeric constants, or a variable defined earlier in 
code?

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"

> On Apr 29, 2020, at 3:35 PM, Carl Hoefs via Cocoa-dev 
>  wrote:
> 
> There are no extensions or categories in the project. 
> I changed the -newData: method name to -arrivalOfNewData:. 
> I changed the newTimer variable name to theTimer. 
> I rebooted the machine. 
> 
> No joy.
> 
> I realize this is no longer a Cocoa problem, but what - even theoretically - 
> could cause this? 
> As shown in the debugger, the timer gets created with the wrong time interval 
> value, by a consistent factor of 20.
> 
> -Carl
> 
> 
>> On Apr 29, 2020, at 2:24 PM, Andy Lee  wrote:
>> 
>> I did the same just now in a macOS project.  Copied your code and added a 
>> newData: method.  This is with Xcode 11.2.1 on Mojave, 10.4.6.  Works fine 
>> for me.  Weird!
>> 
>> @implementation AppDelegate
>> 
>> - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
>>NSTimer *newTimer = [NSTimer timerWithTimeInterval:1.0  // should be 1/sec
>>target:self
>>  selector:@selector(newData:)
>>  userInfo:nil
>>   repeats:YES];
>>[[NSRunLoop mainRunLoop] addTimer:newTimer
>>  forMode:NSRunLoopCommonModes];
>> }
>> 
>> - (void)newData:(NSTimer *)timer {
>>NSLog(@"timer is %@", timer);
>> }
>> 
>> @end
>> 
>> 2020-04-29 17:20:45.331469-0400 NSTimerQuestion[21676:3985041] Metal API 
>> Validation Enabled
>> 2020-04-29 17:20:46.413190-0400 NSTimerQuestion[21676:3985041] timer is 
>> <__NSCFTimer: 0x6370eb80>
>> 2020-04-29 17:20:47.412968-0400 NSTimerQuestion[21676:3985041] timer is 
>> <__NSCFTimer: 0x6370eb80>
>> 2020-04-29 17:20:48.413525-0400 NSTimerQuestion[21676:3985041] timer is 
>> <__NSCFTimer: 0x6370eb80>
>> 2020-04-29 17:20:49.413373-0400 NSTimerQuestion[21676:3985041] timer is 
>> <__NSCFTimer: 0x6370eb80>
>> 2020-04-29 17:20:50.412610-0400 NSTimerQuestion[21676:3985041] timer is 
>> <__NSCFTimer: 0x6370eb80>
>> ...
>> 
>> --Andy
>> 
>> On Apr 29, 2020, at 5:15 PM, Alex Zavatone via Cocoa-dev 
>> mailto:cocoa-dev@lists.apple.com>> wrote:
>>> 
>>> I used your code in an iOS project and it works as expected.
>>> 
>>> 2020-04-29 16:14:02.254107-0500 Timer[83275:13268128] Wed Apr 29 16:14:02 
>>> 2020
>>> 2020-04-29 16:14:03.254048-0500 Timer[83275:13268128] Wed Apr 29 16:14:03 
>>> 2020
>>> 2020-04-29 16:14:04.253957-0500 Timer[83275:13268128] Wed Apr 29 16:14:04 
>>> 2020
>>> 2020-04-29 16:14:05.254170-0500 Timer[83275:13268128] Wed Apr 29 16:14:05 
>>> 2020
>>> 2020-04-29 16:14:06.254490-0500 Timer[83275:13268128] Wed Apr 29 16:14:06 
>>> 2020
>>> 2020-04-29 16:14:07.254570-0500 Timer[83275:13268128] Wed Apr 29 16:14:07 
>>> 2020
>>> 2020-04-29 16:14:08.254651-0500 Timer[83275:13268128] Wed Apr 29 16:14:08 
>>> 2020
>>> 2020-04-29 16:14:09.253715-0500 Timer[83275:13268128] Wed Apr 29 16:14:09 
>>> 2020
>>> 2020-04-29 16:14:10.254741-0500 Timer[83275:13268128] Wed Apr 29 16:14:10 
>>> 2020
>>> 
>>> I’ll mail you the project offlist.
>>> 
>>> 
>>> 
 On Apr 29, 2020, at 4:07 PM, Carl Hoefs via Cocoa-dev 
 mailto:cocoa-dev@lists.apple.com>> wrote:
 
 On Apr 29, 2020, at 1:53 PM, Carl Hoefs via Cocoa-dev 
 mailto:cocoa-dev@lists.apple.com>> wrote:
> 
> On Apr 29, 2020, at 1:43 PM, Steve Mills via Cocoa-dev 
> mailto:cocoa-dev@lists.apple.com> 
> >> 
> wrote:
>> 
>> On Apr 29, 2020, at 15:36:23, Carl Hoefs via Cocoa-dev 
>> mailto:cocoa-dev@lists.apple.com>> wrote:
>>> 
>>> When I issue NSTimer's +timerWithTimeInterval: method, I'm getting 
>>> unexpected timer firing times (20X faster than expected).
>>> 
>>> ∙ If I specify 1.0 for the time interval, my method gets called 20 
>>> times/sec. 
>>> ∙ If I specify 20.0 for the time interval, my method gets called 1 
>>> time/sec.
>>> ∙ If I specify 100.0 for the time interval, my method gets called 5 
>>> times/sec.
>>> ...etc.
>>> 
>>> Here is my only invocation, called once and nevermore:
>>> 
>>>   NSTimer *newTimer = [NSTimer timerWithTimeInterval:1.0  // should be 
>>> 1/sec
>>>   target:self
>>> selector:@selector(newData:)
>>> userInfo:nil
>>>  repeats:YES];
>>>   [[NSRunLoop mainRunLoop] addTimer:newTimer 
>>> forMode:NSRunLoopCommonModes];
>> 
>> Sounds like multiple timers are being installed. Set a breakpoint that 
>> logs when hit.
>> 

Re: Permission Denied trying to connect to localhost in unit test

2019-12-13 Thread Keary Suska via Cocoa-dev
Yes, you would create a new test target and add all the GUI stuff as a member 
of the test target. Of course, you will want to exclude them from other 
targets. You shouldn’t need to do any library linking since it is a common 
codebase. Simply include the classes and put the glue code in the App Delegate.

Keary Suska
Esoteritech, Inc.


> On Dec 13, 2019, at 7:35 AM, Robert Walsh via Cocoa-dev 
>  wrote:
> 
> Thanks - I just finished doing that.  I stubbed out a simple main that has 
> enough smarts to use this TcpClient the way it will be used in the real app, 
> and I was able to connect to an instance of the server to which the command 
> line tool needs to connect.  This server is running on another machine, not 
> on localhost.  I was able to make this connection without needing to grant 
> any entitlements to the command line tool, so the problem occurs only when 
> trying to run the unit test.  In short, the unit test case is allowed to 
> start a server and accept connections (from telnet, for example), and the 
> class being tested is allowed to connect to an external server when not being 
> run within the test case.  So far, though, the class being tested cannot 
> connect to the server when both are used inside the test case.
> 
> I can probably move forward by testing this particular class the old 
> fashioned way through manual inspection and then mocking it in other classes 
> where it will be used.
> 
> If, though, I want to go the dummy test app route, would I create another 
> target that is a GUI app, either link to a static library containing the 
> testable classes or include them as compile targets, and then create a unit 
> test bundle that targets that GUI app?
> 
> Rob
> 
> 
> 
> From: Keary Suska 
> Sent: Friday, December 13, 2019 12:18 PM
> To: Robert Walsh 
> Cc: Cocoa-Dev (Apple) 
> Subject: Re: Permission Denied trying to connect to localhost in unit test
> 
> I would first test to see if you can access networking at all—i.e. connect to 
> a public HTTP server and see if it works. If it doesn’t, then you are 
> probably running against the entitlements issue. I suspect that the “dummy 
> target” indicated is simply a GUI app wrapper built just for testing but not 
> for deployment. Should be easy enough because it doesn’t have to do anything 
> in the GUI.
> 
> Keary Suska
> Esoteritech, Inc.
> 
> 
>> On Dec 13, 2019, at 4:42 AM, Robert Walsh via Cocoa-dev 
>>  wrote:
>> 
>> The errno is 13 (which I think is just a generic Permission Denied).
>> 
>> I am connecting to localhost.
>> 
>> I did find this post in the Apple Developer Forums 
>> (https://forums.developer.apple.com/thread/52211):
>> How do I unittest a command line application? |Apple Developer 
>> Forums
>> Yes, you can add the unit testing bundle, but it won't let you set Target to 
>> be Tested.. Right. That’s because the machinery to load your test bundle 
>> within a process only works if the process is based on a GUI framework (like 
>> Cocoa or Cocoa Touch).
>> forums.developer.apple.com
>> 
>> 
>> A command line tool typically does not use a GUI framework and thus the test 
>> machinery is unable to load your bundle into that tool.
>> 
>> However, you can test without an app target.  If you set the Target to be 
>> Tested popup to None, Xcode will load your test bundle into its built-in 
>> ‘test runner’ tool, xctest.
>> 
>> This works well for most but there are some gotchas.  Specifically, if the 
>> code you’re using requires entitlements then you won’t be able to test it 
>> like this because there’s no way to give those entitlements to xctest.  The 
>> standard workaround for that is to add a dummy test target app to your 
>> project.
>> 
>> 
>> Assuming the problem is that I need to add the App Sandbox -> Outgoing 
>> Connections (Client) entitlement to the command line target (since I can't 
>> add any entitlements to the test target; clicking "+ Capabilities" brings up 
>> a dialog saying that capabilities are not support for this target), how do I 
>> create "a dummy test target app?"  As I said before, I created the test 
>> target by using the Unit Test Bundle template, and I don't see any other 
>> relevant choices.
>> 
>> 
>> Rob
>> 
>> 
>> 
>> From: Jens Alfke 
>> Sent: Thursday, December 12, 2019 1:58 PM
>> To: Robert Walsh 
>> Cc: Cocoa-Dev (Apple) 
>> Subject: Re: Permission Denied trying to connect to localhost in unit test
>> 
>> 
>> 
>> On Dec 12, 2019, at 7:42 AM, Robert Walsh via Cocoa-dev 
>> mailto:cocoa-dev@lists.apple.com>> wrote:
>> 
>> I am writing a command line application in Objective-C that needs to make a 
>> TCP connection to a server.  In a unit test for the TcpClient class I am 
>> writing, I have a simple TCP server that listens for connections in a 
>> thread.  When I try to connect to this socket from the client socket class, 
>> connect() fails and perror 

Re: Permission Denied trying to connect to localhost in unit test

2019-12-13 Thread Keary Suska via Cocoa-dev
I would first test to see if you can access networking at all—i.e. connect to a 
public HTTP server and see if it works. If it doesn’t, then you are probably 
running against the entitlements issue. I suspect that the “dummy target” 
indicated is simply a GUI app wrapper built just for testing but not for 
deployment. Should be easy enough because it doesn’t have to do anything in the 
GUI.

Keary Suska
Esoteritech, Inc.


> On Dec 13, 2019, at 4:42 AM, Robert Walsh via Cocoa-dev 
>  wrote:
> 
> The errno is 13 (which I think is just a generic Permission Denied).
> 
> I am connecting to localhost.
> 
> I did find this post in the Apple Developer Forums 
> (https://forums.developer.apple.com/thread/52211):
> How do I unittest a command line application? |Apple Developer 
> Forums
> Yes, you can add the unit testing bundle, but it won't let you set Target to 
> be Tested.. Right. That’s because the machinery to load your test bundle 
> within a process only works if the process is based on a GUI framework (like 
> Cocoa or Cocoa Touch).
> forums.developer.apple.com
> 
> 
> A command line tool typically does not use a GUI framework and thus the test 
> machinery is unable to load your bundle into that tool.
> 
> However, you can test without an app target.  If you set the Target to be 
> Tested popup to None, Xcode will load your test bundle into its built-in 
> ‘test runner’ tool, xctest.
> 
> This works well for most but there are some gotchas.  Specifically, if the 
> code you’re using requires entitlements then you won’t be able to test it 
> like this because there’s no way to give those entitlements to xctest.  The 
> standard workaround for that is to add a dummy test target app to your 
> project.
> 
> 
> Assuming the problem is that I need to add the App Sandbox -> Outgoing 
> Connections (Client) entitlement to the command line target (since I can't 
> add any entitlements to the test target; clicking "+ Capabilities" brings up 
> a dialog saying that capabilities are not support for this target), how do I 
> create "a dummy test target app?"  As I said before, I created the test 
> target by using the Unit Test Bundle template, and I don't see any other 
> relevant choices.
> 
> 
> Rob
> 
> 
> 
> From: Jens Alfke 
> Sent: Thursday, December 12, 2019 1:58 PM
> To: Robert Walsh 
> Cc: Cocoa-Dev (Apple) 
> Subject: Re: Permission Denied trying to connect to localhost in unit test
> 
> 
> 
> On Dec 12, 2019, at 7:42 AM, Robert Walsh via Cocoa-dev 
> mailto:cocoa-dev@lists.apple.com>> wrote:
> 
> I am writing a command line application in Objective-C that needs to make a 
> TCP connection to a server.  In a unit test for the TcpClient class I am 
> writing, I have a simple TCP server that listens for connections in a thread. 
>  When I try to connect to this socket from the client socket class, connect() 
> fails and perror reports Permission Denied.
> 
> That's odd. I've written plenty of macOS networking code and not seen this 
> problem. What is the errno value?
> 
> The only thing I can guess is that the Xcode test-runner process is being 
> sandboxed to prevent outgoing networking, but I've definitely run TCP 
> connections from XCTests without problems. Are you connecting to "localhost" 
> / 127.0.0.1, or using an explicit IP address?
> 
> —Jens
> ___
> 
> 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 Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/cocoa-dev%40esoteritech.com
> 
> This email sent to cocoa-...@esoteritech.com

___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: 'altool' cannot be found

2019-06-16 Thread Keary Suska via Cocoa-dev
Looks like something was up with the Cocoa Dev list—you probably see that it 
came in early this morning. Anyway, glad I could be help.

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"

> On Jun 15, 2019, at 12:14 PM, Leo via Cocoa-dev  
> wrote:
> 
> 
> Thanks Keary,
> 
> You helped me solve the issue.
> 
> altool was indeed in this folder:
> 
> /Applications/Xcode.app/Contents/Developer/usr/bin/
> 
> However, xcode-select -p returned /Library/Developer/CommandLineTools
> 
> I reset the path with xcode-select -r.
> 
> Now everything seems to work.
> 
> 
> Thanks,
> Leo
> 
> 
> 
> 
> 
> On 6/15/19 9:56 AM, Keary Suska wrote:
>> I am using that Xcode version and for a while now all Xcode utilities and 
>> command line tools are installed in the Xcode app package. My copy is at 
>> /Applications/Xcode.app/Contents/Developer/usr/bin/altool. Do you find it in 
>> that location?
>> 
>> If so, xcrun should be able to find it. If you run xcode-select -p does it 
>> show the expected path?
>> 
>> Keary Suska
>> Esoteritech, Inc.
>> "Demystifying technology for your home or business"
>> 
>>> On Jun 15, 2019, at 12:12 AM, Leo via Cocoa-dev  
>>> wrote:
>>> 
>>> 
>>> Hi all,
>>> 
>>> I wanted to start building a notarization automation script.
>>> 
>>> However, when I try to use the 'xcrun altool' in Terminal, I get the 
>>> following error:
>>> 
>>> xcrun: error: unable to find utility "altool", not a developer tool or in 
>>> PATH
>>> 
>>> I'm on macOS 10.14.5, Xcode 10.2.1.
>>> 
>>> I then especially downloaded and installed Xcode Command Line Tools - still 
>>> get same error.
>>> 
>>> Other tools like stapler do work.
>>> 
>>> I checked this dir and altool is not there: 
>>> /Library/Developer/CommandLineTools/usr/bin
>>> 
>>> Any idea what's going on?
>>> 
>>> 
>>> Thanks for any help!
>>> 
>>> Leo
>>> ___
>>> 
>>> 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 Subscription:
>>> https://lists.apple.com/mailman/options/cocoa-dev/cocoa-dev%40esoteritech.com
>>> 
>>> This email sent to cocoa-...@esoteritech.com
>> 
> 
> ___
> 
> 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 Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/cocoa-dev%40esoteritech.com
> 
> This email sent to cocoa-...@esoteritech.com

___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: 'altool' cannot be found

2019-06-15 Thread Keary Suska via Cocoa-dev
I am using that Xcode version and for a while now all Xcode utilities and 
command line tools are installed in the Xcode app package. My copy is at 
/Applications/Xcode.app/Contents/Developer/usr/bin/altool. Do you find it in 
that location?

If so, xcrun should be able to find it. If you run xcode-select -p does it show 
the expected path?

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"

> On Jun 15, 2019, at 12:12 AM, Leo via Cocoa-dev  
> wrote:
> 
> 
> Hi all,
> 
> I wanted to start building a notarization automation script.
> 
> However, when I try to use the 'xcrun altool' in Terminal, I get the 
> following error:
> 
> xcrun: error: unable to find utility "altool", not a developer tool or in PATH
> 
> I'm on macOS 10.14.5, Xcode 10.2.1.
> 
> I then especially downloaded and installed Xcode Command Line Tools - still 
> get same error.
> 
> Other tools like stapler do work.
> 
> I checked this dir and altool is not there: 
> /Library/Developer/CommandLineTools/usr/bin
> 
> Any idea what's going on?
> 
> 
> Thanks for any help!
> 
> Leo
> ___
> 
> 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 Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/cocoa-dev%40esoteritech.com
> 
> This email sent to cocoa-...@esoteritech.com

___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com