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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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.

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

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

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

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

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

<    1   2   3   4