How to get log from user

2019-06-11 Thread Gabriel Zachmann via Cocoa-dev
I have a bit of trouble getting a relevant log from a user. I asked him to invoke Console.app, type the keyword of my log messages in the search box, then run my app, then send me all the messages. Unfortunately, no message appear in Console.app. He has sent me a screenshot of Console.app, too. T

boundingRectWithSize gives wrong size

2019-08-28 Thread Gabriel Zachmann via Cocoa-dev
I am trying to determine the size of a piece of text using boundingRectWithSize. The problem is that this method does not return the correct width. (The height seems to be about right.) Sometimes, the width is only a little bit too wide, sometimes it is much too wide. And I could not find a patte

Re: boundingRectWithSize gives wrong size

2019-09-10 Thread Gabriel Zachmann via Cocoa-dev
Thanks a lot to both of you for responding, and sorry for my delay! (In case you forget the context, I have enclosed my original question below.) >> NSRect string_rect = CGRectIntegral( [mesg_string boundingRectWithSize: >> drawRect_.size > What is drawRect_ set to when this is called? Here

Re: boundingRectWithSize gives wrong size

2019-09-11 Thread Gabriel Zachmann via Cocoa-dev
> I must confess that I made the mistake of calculating the size of the text using the attributed string, but I did *not* assign the attributed string to the text layer, but instead I assigned the orig. plain string. That way, the text layer must have used a different font for rendering the tex

CABasicAnimation does not animate bounds.origin of a layer

2019-09-14 Thread Gabriel Zachmann via Cocoa-dev
Maybe, I haven't understood how the animation of the bounds property works, or the bounds property of a CALayer itself , or I am making a stupid mistake. Here is my code: CALayer * imgLayer = [CALayer layer]; imgLayer.contents= (__bridge id) imageRef; imgLayer.dele

Screensaver icon ?

2019-09-17 Thread Gabriel Zachmann via Cocoa-dev
Does anybody know how I can define/set the icon for my screensaver that appears in the left hand sidebar of System Preferences / Desktop & Screensaver / Screensaver ? More specifically: I am writing a screensaver, it works and appears in the sidebar in the System Preferences Screensavers pane.

Re: Cocoa-dev Digest, Vol 16, Issue 87

2019-09-17 Thread Gabriel Zachmann via Cocoa-dev
> > The bounds origin is the origin of the coordinate system for sublayers of > that layer, and thus changing the bounds origin moves sublayers around. Thanks a lot for the insight. Just out of curiosity (or for fellow developers): I have just read up about the bounds property in the NSView doc

Re: Screensaver icon ?

2019-09-17 Thread Gabriel Zachmann via Cocoa-dev
___ 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

Re: Screensaver icon ?

2019-09-17 Thread Gabriel Zachmann via Cocoa-dev
Cool! Thanks a million, that did the trick. Best regards, Gabriel > On 17. Sep 2019, at 19:35, Alex Zavatone wrote: > > Add it in the build phases copy files phase or use the environment variables > to build the path in a shell script and run that as part of your runtime > build scripts. >

Pausing an animation

2019-09-17 Thread Gabriel Zachmann via Cocoa-dev
I have a layer with two animations. I would like to pause this animation occasionally . To do so, I set layer.speed = 0.0; In the past, this has worked (with slightly different animations). However, in this case, the layer seems to just disappear. (the layer occupies the whole screen, and when I

Why is / a metachar in regular expressions ?

2019-09-18 Thread Gabriel Zachmann via Cocoa-dev
In the doc for NSRegularExpression, it says "Characters that must be quoted to be treated as literals are * ? + [ ( ) { } ^ $ | \ . / " I don't see why / is a meta character. It does not appear anywhere else in the documentation as metacharacter. (Also not at http://userguide.icu-project.org

Re: Why is / a metachar in regular expressions ?

2019-09-18 Thread Gabriel Zachmann via Cocoa-dev
>> I don't see why / is a meta character. >> It does not appear anywhere else in the documentation as metacharacter. > > In some languages "/" is used as the delimiter to begin/end a regular > expression, for example in sed where the substitution command is "s/old/new/". Right, good point - same

Re: Pausing an animation

2019-09-19 Thread Gabriel Zachmann via Cocoa-dev
> Setting just the speed will often return you to the “beginning of time” for > your CAMediaTiming compliant object (CALayer and CAAnimation the most common > compliant objects). I think, this is what must have happened in my case. (It's just funny that it did not happen with one animation/layer

Re: Why is / a metachar in regular expressions ?

2019-09-21 Thread Gabriel Zachmann via Cocoa-dev
>> >> Yeah, I'm inclined to think it's an error in the docs. > > If you look at the input expression in this great site, you'll see 2 /'s as > part of it. They mark the beginning and the end (before flags). > > https://regexr.com > OTOH, the doc of NSRegularExpression specifically links to

Views without any layout constraints may clip their content or overlap other views

2019-09-23 Thread Gabriel Zachmann via Cocoa-dev
Recently, I am getting lots of warnings saying "Views without any layout constraints may clip their content or overlap other views" when I build my screen saver. In my case, I ons't think that warning is really important, since the GUI is not resizable (it's just an options pane in the screensav

Animating bounds/position when layer.transform is set, or how to orient an image

2019-09-23 Thread Gabriel Zachmann via Cocoa-dev
Have a layer that displays an image and has some animations attached. The animations modify layer.bounds (just the size changes) and layer.position . Everything works fine, EXCEPT when the image's orientation EXIF flag is set. So, I am also setting the layer.transform to a transformation that br

kCAFilterTrilinear

2019-09-24 Thread Gabriel Zachmann via Cocoa-dev
I am trying out the scaling filter kCAFilterTrilinear on a CALayer. In the doc it says "Some renderers may ignore this, or impose additional restrictions, such as source images requiring power-of-two dimensions" Does anyone know what filter CALayer falls back to, when it ignores kCAFilterTrilin

CGImageSourceCopyPropertiesAtIndex fails sometimes

2019-09-25 Thread Gabriel Zachmann via Cocoa-dev
I have this piece of code in my program: CGImageSourceRef sourceRef = CGImageSourceCreateWithURL( (CFURLRef) url, NULL ); if ( sourceRef == NULL ) { ... display error message 1 return; } CFDictionaryRef fileProps = CGImageSourceCopyPropertiesAtIndex( sourceRef

How to have users select a directory

2019-09-25 Thread Gabriel Zachmann via Cocoa-dev
I am looking for a nice, intuitive way to let users select a directory. Right now, I have a simple TextField in my GUI that shows the current path, and a simple Button next to it that says "Change". When users click on it, it opens an NSOpenPanel that is runModal. This works fine, but I am wonder

Questions regarding release

2019-09-25 Thread Gabriel Zachmann via Cocoa-dev
A few years ago, I switched my code to ARC. Now, I have this in my code: CGImageRef imageRef = CGImageSourceCreateImageAtIndex( sourceRef, 0, NULL ); ... NSImage * nsimage = [self convertToNSImage: img withOrientation: img_orientation]; assign nsimage to a layer ... C

Confusion about release mode in Xcode

2019-09-25 Thread Gabriel Zachmann via Cocoa-dev
I haven't released my software (screensaver) in many years, so please bear with me, I am not up-to-date any more how this works. I have tried to create a new scheme, then changed the Build Configuration to "Release". But in Build Phases ⟶ Copy Files it still says that the product is copied fro

Re: Questions regarding release

2019-09-26 Thread Gabriel Zachmann via Cocoa-dev
Thanks a lot for your response. >> Is it safe to do it after assigning the nsimage to the layer, but before >> deleting the layer? > I would think so, but it is hard to say without knowing what > convertToNSImage:withOrientation actually does under the hood. It likely > either retains or

Re: Questions regarding release

2019-09-26 Thread Gabriel Zachmann via Cocoa-dev
>> >>> Is the IOObjectRelease() right or wrong ? >> I’m not entirely sure since I can’t find the docs for >> IOServicePortFromCGDisplayID. > > Given that the code fragment shows it as a message being sent to “self”, this > looks like Gabriel’s own method. By the standard Obj-C clang naming

Re: Questions regarding release

2019-09-26 Thread Gabriel Zachmann via Cocoa-dev
> > The Xcode "analyze" step should check for errors of this kind. I have xcode > set to analyze on every build, since it's usually not too slow. Thanks a lot for the hint! I tried it and it works pretty well. I actually found 2 (small) leaks. There is one place in my code (different from my

Re: Questions regarding release

2019-09-26 Thread Gabriel Zachmann via Cocoa-dev
;t be omniscient about your >> code. >> >> When you start a method name with "make" or "new" or "create" it assumes >> that you're returning a +1 value. >> >> -- >> Glenn L. Austin, Computer Wizard and Race Car Driver

Re: Questions regarding release

2019-09-26 Thread Gabriel Zachmann via Cocoa-dev
> The issue in the below code to my eye is that you allocate a path with > CGPathCreateWithRect (+1) but then don't release it. > > In that case, I am wondering: > doesn't ownership pass to the textlayer ? > If yes, shouldn't textlayer release the path when it gets destroyed by the > ARC? > > C

Re: Questions regarding release

2019-09-27 Thread Gabriel Zachmann via Cocoa-dev
>> >> So, if I understand you correctly, I should do this: >> >> textlayer.shadowPath = CGPathCreateWithRect( textlayer.bounds, NULL ); >> CFRelease( textlayer.shadowPath ) >> >> ? >> Is that correct? > From a memory perspective, yes. This sounds to me like there could be other perspe

Re: Questions regarding release

2019-09-27 Thread Gabriel Zachmann via Cocoa-dev
> > CGPathRef thePath = CGPathCreateWithRect( textlayer.bounds, NULL ); > textlayer.shadowPath = thePath; > CFRelease( thePath ); > Thanks a lot! that makes sense to me. Best regards, Gabriel smime.p7s Description: S/MIME cryptographic signature

How to compile for macOS 10.11 ?

2019-10-11 Thread Gabriel Zachmann via Cocoa-dev
I have some code that works fine in macOS 10.14. The only warnings I get during compilation are related to the GUI (about clipping and constraints and the like). Now I would like to compile this for 10.11 (El Capitan). Problem is, I only have one Macbook running 10.14 In Xcode, I switched the de

Re: Thoughts on productivity

2019-10-24 Thread Gabriel Zachmann via Cocoa-dev
>> >> >> >> https://developer.apple.com/account/#/feedback-assistant >> >> https://developer.apple.com/account/#/forums > > > Good luck with that. I've been using OSX/macOS since the Panther days and > quite frankly I don't think Apple cares. Occasionally, I send a bugreport via https://feed

Thoughts on Objective-C++

2019-11-11 Thread Gabriel Zachmann via Cocoa-dev
> > Maybe I'm wrong, but we have experienced enough past pivots and > bridge-burnings that another seems overdue. > Yes, I can understand that. On the other hand, at least in the old days, Microsoft kept all the old API's around for so many years (for backwards compatibility), including bug

Re: Thoughts on Objective-C++

2019-11-12 Thread Gabriel Zachmann via Cocoa-dev
> > I'm not just joking here. Obj-C's dynamic nature is at the heart of a lot of > Cocoa's powerful features like Interface Builder and KVO. Super-static > languages like C++ don't work well for GUI development, IMHO, because they > make it hard to compose high-level objects together. I agre

Re: Re: Thoughts on Objective-C++

2019-11-13 Thread Gabriel Zachmann via Cocoa-dev
> be a good time for a SwiftUI pivot. If true, Cocoa is the new Carbon. > I think, eventually, maybe in 5 years' time, that will be the case. This is really just a guess, I have no insights into Apple's roadmap. Speaking of which: I have never been there myself, but wouldn't the apple enginee

Re: Thoughts on Objective-C++

2019-11-14 Thread Gabriel Zachmann via Cocoa-dev
> Phil mentioned to me in about 1996, 1997 back at Macromedia that it was the > goal for Apple to turn computers into the equivalent o kitchen appliances. > You won’t upgrade your Maybe the metaphor was more referring to the ease-of-use or the market proliferation. The metaphors certainly ha

Re: Future of Cocoa

2019-11-21 Thread Gabriel Zachmann via Cocoa-dev
> > If someone can afford days/weeks to do watch WWDC sessions consistently > every year it's great. That's not a luxury all of us can afford and it's > ridiculous to think this should be a requirement. > But then, I am wondering, how does your company ensure your programmers stay up-to-date?

Re: Future of Cocoa #2

2019-12-11 Thread Gabriel Zachmann via Cocoa-dev
> QT is probably the most viable cross-platform tool, but steep learning > curve and mediocre GUI. Will it survive if Cocoa is deprecated? Good question - I have no idea. But I suggest you reach out to the support, or ask on Qt's forums about roadmaps, or meet them in person at an expo/confer

How to check whether directory tree has changed?

2019-12-21 Thread Gabriel Zachmann via Cocoa-dev
Is there a quick and easy way to check whether or not a directory tree has changed? I am only interested in file additions or deletions, somewhere beneath a specific root directory, e.g., ~/Data/some_directory. However, I am interested in such changes between different invocations of my progra

Re: How to check whether directory tree has changed?

2019-12-21 Thread Gabriel Zachmann via Cocoa-dev
Thanks a lot! Does it really watch subfolders, too? Also, it seems to me like it works only while the program is running. I am mostly interested in changes that happen "behind the program's back", i.e., while it is *not* running. Does your code really handle that? Best regards, Gabriel > I’ve

Re: How to check whether directory tree has changed?

2019-12-21 Thread Gabriel Zachmann via Cocoa-dev
> Are you looking to detect changes that happen in between launches of your > app? If so you’d have to save state and compare that saved state to the dir > contents each time the app is launched. Right. I was hoping there is an easy way to do this. Something like a recursive check sum over the

Questions about sandboxing under Catalina

2020-01-08 Thread Gabriel Zachmann via Cocoa-dev
I have two questions regarding sandboxing. 1. In my screensaver, I try to search the Pictures directory in the user's home. It is OK - for now - if my app cannot access any .photoslibrary, but I'd like to pick up any other images in ~/Pictures. I get the path using this line of code: [NSHom

Re: Questions about sandboxing under Catalina

2020-01-10 Thread Gabriel Zachmann via Cocoa-dev
Steve, thanks a lot for your response! >> >> In my screensaver, I try to search the Pictures directory in the user's home. >> It is OK - for now - if my app cannot access any .photoslibrary, but I'd >> like to pick up >> any other images in ~/Pictures. >> >> I get the path using this line of co

Re: Questions about sandboxing under Catalina

2020-01-10 Thread Gabriel Zachmann via Cocoa-dev
>> >> So, is .../Containers/.../Data/Pictures linked to ~/Pictures automatically? > No. The user has to give your app permission to see the contents of > ~/Pictures. > > https://developer.apple.com/library/archive/documentation/Security/Conceptual/AppSandboxDesignGuide/AboutAppSandb

Xcode can't launch System Preferences any more

2020-02-11 Thread Gabriel Zachmann via Cocoa-dev
XCode used to be able to launch SystemPreferences under Mojave. In the active scheme used for building, under Run / Info / Executable, I have SystemPreferences.app selected. "Launch" is set to "automatically". Now, after Xcode has (successfully) built my screensaver, I get this error message:

Sorting an array

2020-02-11 Thread Gabriel Zachmann via Cocoa-dev
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 [imagefiles_ sortUsingDescriptors: @[sd] ]; where imagefiles_ is an NSMutableArray* . Now,

Handling of paths through sandbox

2020-02-11 Thread Gabriel Zachmann via Cocoa-dev
I have a question regarding the proper handling of paths under Catalina, some of which go through the Container, some don't. More specifically, I get the Pictures folder using this line of code: dir_to_scan = [NSHomeDirectory() stringByAppendingPathComponent: @"Pictures/"] This gives me a path

Re: Sorting an array

2020-02-11 Thread Gabriel Zachmann via Cocoa-dev
Great! Thanks a lot. (Just for the record: it's called sortUsingSelector: ) 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 c

Catching keystrokes in my screensaver under Catalina

2020-02-11 Thread Gabriel Zachmann via Cocoa-dev
I used to be able to catch keystrokes in my screensaver under Mojave by defining my own methods -keyDown: and/or -processKey: This does not work any more under Catalina, it seems. My screensaver gets killed (stopped) right away. Not even -(void)stopAnimation is called any more! Does anyone

Re: Handling of paths through sandbox

2020-02-12 Thread Gabriel Zachmann via Cocoa-dev
Thanks a lot for your response. >> Problem is that I can't just do >> >> [ array_with_all_images addObject: [path substringFromIndex: ([dir_to_scan >> length] + 1)] ]; > > What is this supposed to be an array of? File names? Partial paths underneath > ~/Pictures? Exactly. The problem is tha

Re: Handling of paths through sandbox

2020-02-12 Thread Gabriel Zachmann via Cocoa-dev
>> >> The problem is that the path names can get very long. >> And I am going to show them to the user. > > There is support in AppKit for displaying file paths to the user. > Unfortunately it's been I guess I should have said that I display the paths as a simple text overlay in my screensaver

kCGImageStatusInvalidData

2020-02-16 Thread Gabriel Zachmann via Cocoa-dev
___ 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.c

kCGImageStatusInvalidData

2020-02-17 Thread Gabriel Zachmann via Cocoa-dev
[From the mailing list, I have received an empty mail, so I am going to try again] In my screensaver , I am loading images using this piece of code: CGImageSourceRef sourceRef = CGImageSourceCreateWithURL( (CFURLRef) url, NULL ); if ( sourceRef == NULL ) { ... } CGImageSo

More fun with CGImageSourceCreateWithURL

2020-02-17 Thread Gabriel Zachmann via Cocoa-dev
One of my users (maybe, they others don't bother) told me that occasionally, they get an error message that must originate from this piece of code in my screensaver: NSURL * url = [NSURL fileURLWithPath: [self absolutePathFor: filename_] isDirectory: NO]; if ( url == NULL ) {

Re: More fun with CGImageSourceCreateWithURL

2020-02-17 Thread Gabriel Zachmann via Cocoa-dev
>> >> NSURL * url = [NSURL fileURLWithPath: [self absolutePathFor: filename_] >> isDirectory: NO]; >> if ( url == NULL ) >> { >> ... // never happened so far >> } >> CGImageSourceRef sourceRef = CGImageSourceCreateWithURL( (CFURLRef) url, >> NULL ); >> if ( sourceRef == NULL )

Still problems accessing files from my screensaver

2020-02-18 Thread Gabriel Zachmann via Cocoa-dev
Sorry for bothering again. I would like to obtain some clarification regarding the problems I am having when my screensaver tries to load images that reside on an external disk. I have read the dev docs on sandboxing ( https://developer.apple.com/library/archive/documentation/Security/Conceptual

Re: Still problems accessing files from my screensaver

2020-02-18 Thread Gabriel Zachmann via Cocoa-dev
> And that?s exactly why you need to store SSBs. You only have permission to an > NSOpenPanel-gotten file for the current run or your program. Once it quits, > that permission goes away. I understand that - but how can I store SSBs, if the app (legacyScreenSaver) does not have the com.apple.s

Confusion about screen resolution

2020-02-22 Thread Gabriel Zachmann via Cocoa-dev
When my screensaver gets invoked by the screensaver engine, it calls - (id) initWithFrame: (NSRect) frameRect isPreview: (BOOL) preview Funny thing is, when I print the frameRect to the log, I get 1680 x 1050. But my laptop screen really has 2880 x 1800! (That's what I get from "About this Mac

Re: Confusion about screen resolution

2020-02-22 Thread Gabriel Zachmann via Cocoa-dev
> > What have you set in System Preferences > Displays > Resolution. On a Retina > MacBook most I have set it to "Default for display" - shouldn't that set the resolution to the native one? Best regards, Gabriel ___ Cocoa-dev mailing list (Cocoa-

Re: Confusion about screen resolution

2020-02-22 Thread Gabriel Zachmann via Cocoa-dev
> > 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 scaled by this odd factor, before writing its contents into the frame buffer. I am curious as to why that doesn't cause any aliasing artefacts, or anti-aliasing artefa

Re: Confusion about screen resolution

2020-02-22 Thread Gabriel Zachmann via Cocoa-dev
> > Does it make sense that starting at 1.7 gives you a 0.3 headroom for ‘zoom’ > without having to upsample? You mean the accessibility zoom? No, it does not make sense to me. First of all, I can zoom in much more, so why waste 0.3 headroom although most people don't even know about it? Second

Re: Confusion about screen resolution

2020-02-22 Thread Gabriel Zachmann via Cocoa-dev
> For Retina displays, the backing store's size is always 2x the size in points > that Cocoa reports. The backing store is then scaled to the display's > physical resolution. > > Also, even if though the default point-size-to-display-physical-pixels used > to be 2x, remember that other scali

Sharing code between screensaver and regular app

2020-03-02 Thread Gabriel Zachmann via Cocoa-dev
I am trying to replicate what this guy suggests: https://medium.com/better-programming/how-to-make-a-custom-screensaver-for-mac-os-x-7e1650c13bd8 under section "Additional Debugging". The idea is to create a standalone app that shares as much code with the screensaver as possible. I am using

Re: Sharing code between screensaver and regular app

2020-03-02 Thread Gabriel Zachmann via Cocoa-dev
Thanks a lot for your response! > > File/New Project - Select MacOS and then “App” (from the New Project Dialog). That is what I did: see this screen recording: https://owncloud.informatik.uni-bremen.de/index.php/s/br8rN3HGYfj9w3d

Embedded binary is not signed with the same certificate as the parent app

2020-03-02 Thread Gabriel Zachmann via Cocoa-dev
I have a naked macOS app (created with Xcode's template "App"). I get this funny error message Embedded binary is not signed with the same certificate as the parent app but only, when I switch to Release *and* when I add a Copy Files phase with Destination = Absolute Path and Name = MyPr

Re: Embedded binary is not signed with the same certificate as the parent app

2020-03-03 Thread Gabriel Zachmann via Cocoa-dev
lex Zavatone mailto:z...@mac.com>> > wrote: > > Please send a screenshot of your copy files phase so we can clearly see what > you are trying. > > Thanks. > > Sent from my iPhone > >> On Mar 2, 2020, at 7:12 PM, Gabriel Zachmann via Cocoa-dev >> mai

Re: Embedded binary is not signed with the same certificate as the parent app

2020-03-03 Thread Gabriel Zachmann via Cocoa-dev
> > Why are you copying that app you are trying to build? > OK, I could just use the app bundle under /tmp/Release , I give you that. But I would also like to *understand* why things are not working (if they are not working). So, why would copying the app bundle to some other place (using in

Re: Security scoped bookmarks example?

2020-03-04 Thread Gabriel Zachmann via Cocoa-dev
I am still having problems in my screensaver to access files that are stored on an external disk. The disk is just a simple hard disk connected to my Macbook via USB. (It is an important use case, since a lot of people like to keep there huge image collections on external hard disks.) I can acce

Re: Image GPS Properties Question

2020-03-04 Thread Gabriel Zachmann via Cocoa-dev
> > Given a URL to an image I currently do this to grab image properties > (ignoring error handling to simplify the example code) > > let imgRef = CGImageSourceCreateWithURL(url as CFURL, nil) > let imgProps = CGImageSourceCopyPropertiesAtIndex(imgRef, 0, nil) as > NSDictionary? > let GPSDict

Re: Security scoped bookmarks example?

2020-03-05 Thread Gabriel Zachmann via Cocoa-dev
> > So, you created a security scoped bookmark, then what did you do with it? You > should store it in user defaults, then load it from user defaults the next > time your code starts up, reconstitute it back into a security scoped URL, > and then use *that* URL (literally that object, not a dif

Getting rid of "cannot check for malicious software"

2020-03-05 Thread Gabriel Zachmann via Cocoa-dev
When installing my screensaver (i.e., downloading and double-clicking), some people get a funny warning saying "cannot check for malicious software". In my Xcode project, I have "Automatically manage signing" switched on, with the signing certificate "Development". Is there anything I can do to m

Sharing NIB/XIB between different apps?

2020-03-06 Thread Gabriel Zachmann via Cocoa-dev
Is it possible to share one NIB/XIB between two different apps? If yes, what would be the best approach for development: different Xcode projects, or different targets within the same Xcode project? More specifically, I have a screensaver with a relatively big configuration options sheet. All th

applicationDidFinishLaunching not being called

2020-03-09 Thread Gabriel Zachmann via Cocoa-dev
I must have done something very stupid, accidentally, but the method applicationDidFinishLaunching in my AppDelegate is not being called any more. I have googled and tried a few things, of course, to no avail. Does anyone have an idea what it might be? Maybe, some kind soul can take a quick look

Re: applicationDidFinishLaunching not being called

2020-03-09 Thread Gabriel Zachmann via Cocoa-dev
ook and see the individual classes, but I need this in an older > format to even open it. : / > >> On Mar 9, 2020, at 6:55 PM, Gabriel Zachmann via Cocoa-dev >> mailto:cocoa-dev@lists.apple.com>> wrote: >> >> I must have done something very stupid, acciden

ScreenSaverView does not get resized

2020-03-10 Thread Gabriel Zachmann via Cocoa-dev
I have a ScreenSaverView instantiated and added to a window of a stand-alone app like this: In MasterViewController: - (void) viewDidLoad { [super viewDidLoad]; saver_ = [[ArtSaverView alloc] initWithFrame: self.view.frame isPreview: NO ]; [self.view addSubview: saver_]; [s

Can't delete file on external disk

2020-03-12 Thread Gabriel Zachmann via Cocoa-dev
In my app, I collect lists of files that reside on an external disk. When the user opens the directory of the files, I create a security-scoped bookmark like this: directoryBookmark_ = [dir bookmarkDataWithOptions: NSURLBookmarkCreationWithSecurityScope includingResour

Re: Can't delete file on external disk

2020-03-12 Thread Gabriel Zachmann via Cocoa-dev
> > Are you using startAccessingSecurityScopedResource? Sorry I forgot to mention: yes, I do startAccessingSecurityScopedResource. Also, reading the files works just fine. (Haven't tried writing on them, because that is of no concern in my app. Just reading or deleting.) Best regards, Gabri

How to ask user to grant access ?

2020-03-13 Thread Gabriel Zachmann via Cocoa-dev
I am doing a directory enumeration , collecting a list of files for accessing them later. When I encounter aliases / symlinks, I would like to follow them. As far as I understand, in a sandboxed app, I need to ask the user to grant my app access to the directories the aliases point to. I guess I

How to ask user to grant access ?

2020-03-13 Thread Gabriel Zachmann via Cocoa-dev
PS: So far, I am not even getting permissions within the same app invocation. What I have tried is, when I hit an alias that is also a directory, I open an NSOpenPanel with setDirectoryURL: resolved URL of the alias. The user hits OK, then I try to set up an enumerator with that URL. However,

Open a panel in secondary thread?

2020-03-21 Thread Gabriel Zachmann via Cocoa-dev
Is it possible to open an NSOpenPanel in a secondary thread? I create the thread like this: directoryScanThread_ = [[NSThread alloc] initWithTarget: self selector: @selector(scanDirectory:)

Re: Open a panel in secondary thread?

2020-03-22 Thread Gabriel Zachmann via Cocoa-dev
> > Don't know if this helps you but you can look into dispatch_sync > and dispatch_async. > Thanks a lot! That made things very easy. I am opening the panel now with this piece of code: __block NSURL * user_permitted_url; __block long int result;

Re: Open a panel in secondary thread?

2020-03-23 Thread Gabriel Zachmann via Cocoa-dev
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 to execute any UI code in the main thread, or so I thought. As far as I understand, the dispatch_ge

Re: Open a panel in secondary thread?

2020-03-23 Thread Gabriel Zachmann via Cocoa-dev
>>> 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 I thought. >> As far as I understand, the dispatch_get_main_queue is e

Re: Open a panel in secondary thread?

2020-03-23 Thread Gabriel Zachmann via Cocoa-dev
> > Yes, understood. Does the user have to ask for this process to begin, or > does it start automatically? The user starts the process by opening a directory. Then, when the process hits an alias pointing to some other directory, the process will ask the user again to open that directory. So,

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

2020-04-23 Thread Gabriel Zachmann via Cocoa-dev
> > It appears the problem is not with a local service, but that Apple > actually ?phones home? when a program asks for display name. > > I don?t know if this is common knowledge, but with notarization, Apple > now validates executables on your system before they are executed, and > it does so

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

2020-04-23 Thread Gabriel Zachmann via Cocoa-dev
> > I believe that is why you are supposed to staple notarization tickets to your > apps. > Then, why would it "phone home" in case there is an internet connection? Best regards, Gabriel ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Ple

Notarization: basic questions

2020-04-25 Thread Gabriel Zachmann via Cocoa-dev
This whole notarization business is still pretty new to me. I would like to notarize my screen saver, and distribute it outside the app store. I tried to read up on it as much as I can, but I still have a few very basic questions. As far as I understand, I need to enroll in the apple developer

Customizing the Notarization Workflow fails

2020-04-25 Thread Gabriel Zachmann via Cocoa-dev
I am trying to follow these instructions: https://developer.apple.com/documentation/xcode/notarizing_macos_software_before_distribution/customizing_the_notarization_workflow?language=objc However, I can't even achieve the first step ("Export a Package for Notarization"). As per the instruction

Re: Customizing the Notarization Workflow fails

2020-04-25 Thread Gabriel Zachmann via Cocoa-dev
Thanks a lot for your response. > I’m not sure how you would script the export, but if you go to menu option > Window -> Organizer, you can see your archives. Yes, I can see them. But when I do "Show in Finder", then "Show package contents", they contain nothing (except for an empty Products f

Inconsistent fullscreen modes

2020-05-01 Thread Gabriel Zachmann via Cocoa-dev
In my app, I defined a key that switches the window/view to fullscreen mode and back. Essentially, I use these commands: [self enterFullScreenMode: [NSScreen mainScreen] withOptions: nil]; and [self exitFullScreenModeWithOptions: nil]; where self is an NSView. This seems

Re: Inconsistent fullscreen modes

2020-05-01 Thread Gabriel Zachmann via Cocoa-dev
Thanks a lot for your response! I apologize for bothering you (and anybody else), because I have already found a solution myself. For the record, I am currently using [window_ toggleFullScreen: nil]; where window_ is what I get as parameter in - (void) viewWillMoveToWindow: (NSWindow

Minimizing my app kills timer ?

2020-05-02 Thread Gabriel Zachmann via Cocoa-dev
I've got an app that makes heavy use of ScreenSaverView (i.e., creates an instance of a subclass). In that view, I am creating some CALayers with animations, which I exchange occasionally in method - (void) animateOneFrame of my class. All works fine, except when I minimize my app (using the

Re: Customizing the Notarization Workflow fails

2020-05-03 Thread Gabriel Zachmann via Cocoa-dev
Thanks a million to everybody for responding to my question! I have been following Joao's instructions at https://stackoverflow.com/questions/53101626/how-to-notarize-an-app-bundle-containing-helpers-embedded-in-it/56799591#56799591

Re: Minimizing my app kills timer ?

2020-05-04 Thread Gabriel Zachmann via Cocoa-dev
> >> On May 2, 2020, at 09:15, Gabriel Zachmann via Cocoa-dev >> wrote: >> >> ?I've got an app that makes heavy use of ScreenSaverView (i.e., creates an >> instance of a subclass). > > ScreenSaverView is for screensavers, not apps. It?s beh

Re: Minimizing my app kills timer ?

2020-05-04 Thread Gabriel Zachmann via Cocoa-dev
> The screensaver animation in macOS is reliant on the engine that drives it. > Recently that changed from an older engine to what we can only guess is a > newer one, but some of them still run in what is known as a newly named > legacyScreenSaver, yet ScreenSaverEngine still fits in there someh

Re: Minimizing my app kills timer ?

2020-05-05 Thread Gabriel Zachmann via Cocoa-dev
>> >> That is what I'm doing. >> I start my own timer, which periodically calls -animateOneFrame. >> I call -stopAnimation when the app is hidden, etc. > > Are you calling the base class' startAnimation or stopAnimation methods? Or > do you override those and never call the base class? I overr

Re: Cocoa-dev Digest, Vol 17, Issue 62

2020-05-07 Thread Gabriel Zachmann via Cocoa-dev
>> >> Well, in my own -startAnimation, I do >> [super startAnimation]; > > Which could be doing all sorts of things that assume it's running in a known > screensaver environment. True. Should I skip this statement in case -startAnimation has been compiled into the app? Best regards, Gabrie

Concurrent loading of images ?

2020-05-08 Thread Gabriel Zachmann via Cocoa-dev
I have kind of a slide-show app. Sometimes, when it switches from one image to the next, there is a noticeable lag when the file size of the next image is very big, say, 50 MB or more. Sometimes, it seems that loading the image takes 1-2 seconds. So, I was thinking, maybe it helps to load the ne

Re: Concurrent loading of images ?

2020-05-08 Thread Gabriel Zachmann via Cocoa-dev
Thanks for the question: MacOS. > > iOS or MacOS? ___ 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/Unsub

Re: Concurrent loading of images ?

2020-05-08 Thread Gabriel Zachmann via Cocoa-dev
> I second the use of GCD. Its also considerably simpler than NSThread, > NSOperationQueue/NSOperation et al. This is the kind of operation that GCD > was invented for. Thanks a lot for your response(s). To me a queue suggests that you have lots and lots of tasks arriving from the produ

Re: Concurrent loading of images ?

2020-05-08 Thread Gabriel Zachmann via Cocoa-dev
> Sure. Just be aware that if you're using NSImage, simply loading an NSImage > does not rasterize it; the class tries to be 'lazy' about doing work. So your > background task should explicitly render it, e.g. into an NSBitmapImageRep. I am using CGImageSourceCreateImageAtIndex and related funct

Re: Concurrent loading of images ?

2020-05-09 Thread Gabriel Zachmann via Cocoa-dev
> I would add, that for a long running process, open ended work, or task, I > would favor a thread. But for short and finite items I would favor > GCD/NSOperationQueue. > > Are you going to only load one image, the next image, in this concurrent > loading scenario? Or, will you be loading m

  1   2   3   4   >