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.

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

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

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

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;

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

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: 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

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:

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

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 -

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

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

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

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

Re: Questions regarding release

2019-09-26 Thread Gabriel Zachmann via Cocoa-dev
ut 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 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
> 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? > >

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

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

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

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

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

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(

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

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 ...

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

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