Post

Replies

Boosts

Views

Activity

Reply to NetFSMountURLSync won't mount my FTP volume
Still looking for a way to mount a remote FTP volume from within my macOS app. I have just tried the Terminal command open ftp://user:password @ server.domain.com/ (without those 2 spaces) to mount my FTP volume. It works but it's async so it doesn't return a value (mounted or not). And I don't know how to invoke a callback when the task is done. Also I must define the username and password within the address and it's not a good practice. Recap FSMountServerVolumeSync is deprecated… NetFSMountURLSync asks for a share and I cannot use it. The Terminal command "open" is async so it does't return a value nor it invokes a callback. mount_ftp needs for an existing directory as a mount point as e.g. /Volumes/MyFTPDisk but I can't create a directory within the /Volumes folder with createDirectoryAtPath: For now I stay stuck on the deprecated point 1. Too bad.
2w
Reply to My macOS app+helper is not in the System Preferences/Login Item/ "Allow Background" list
Thank you Kevin. I have solved the trouble thanks to your advises. I had indeed several "old" 1.x.x versions of my app on my HD, all without the Helper. I introduced the Helper on the latest version 2.0 I have been working on. I thought the macOS looked for the same version as the one I launched with the Helper and put it in the Login Items list. I assumed it wrongly. So, I guess that now I have to tell my customers to delete the previous version(s) from their HD then install the latest 2.0 version. I will run some test with some of my customers. Thanks a lot again.
Aug ’24
Reply to Metal 3D Line Width
The trouble is even worse when you draw in 3D. A rectangle (instead of a line) could even look as a flat invisible short line if the camera is almost aligned to the line and a little farther than the end point of the rectangle. We should draw a tiny cylinder to solve the trouble, which means so many triangles. Think about a simple grid 20 x 20 lines with 32 triangles each. That is 12800 triangles. Also, the point is a squared rectangle only. If you need of a circle you have to draw it.
Aug ’22
Reply to Change self.contentView.layer.maskedCorners in a chidWindow
I solved the trouble by using a performSelector with a small delay to setup the maskedCorners for the first time. With this solution I don't see that dark square-window-border close to the maskedCorners. (void)applicationDidFinishLaunching:(NSNotification*)aNotification { drawer.hasShadow = YES;     [drawer setOpaque:NO];     [drawer setBackgroundColor:[NSColor clearColor]];     [drawer setStyleMask:NSWindowStyleMaskBorderless | NSWindowStyleMaskFullSizeContentView];     drawer.contentView.wantsLayer = YES;     drawer.contentView.layer.frame = drawer.contentView.frame;     drawer.contentView.layer.masksToBounds = YES;     drawer.contentView.layer.cornerRadius = 10.0;     drawer.contentView.layer.backgroundColor = [NSColor clearColor].CGColor;     [mainWindow addChildWindow:drawer ordered:NSWindowBelow]; [drawer performSelector:@selector(SetMaskedCorners) withObject:nil afterDelay:0.1]; // instead of [drawer SetMaskedCorners]; } // On the drawer class I do (void)SetMaskedCorners {     if(self.mSide == kSideRight){         self.contentView.layer.maskedCorners = kCALayerMaxXMinYCorner | kCALayerMaxXMaxYCorner;     }     else{         self.contentView.layer.maskedCorners = kCALayerMinXMinYCorner | kCALayerMinXMaxYCorner;     }     [self.contentView setNeedsLayout:YES]; }
Mar ’21
Reply to Get the window titlebar background color
If I set any background color, it always work, no matter the color I choose, the background color is always equal to the background titlebar color. e.g. self.window.backgroundColor = anyColor; Anyway, actually I simply turn ON the NSWindow "Transparent Title Bar" check-box on IB. I use no code at all. So when the window is active I get a window background color equal to the background title bar RGB color as 40,40,40 on dark mode and 246,246,246 on light mode. I noticed that the other windows as e.g. the System Preferences window, when active, have these RGB colours: 54,54,54 on dark mode and 252,252,252 on light mode. So, the color is indeed different. Unique (titlebar/back) but different than on the other windows.
Mar ’21
Reply to Get the window titlebar background color
Thank you Claude. In the window.contentView subclass I set (void)awakeFromNib { self.window.titlebarAppearsTransparent = true; } (void)drawRect:(NSRect)rect {     [self.window.backgroundColor set];     NSRectFill(rect); } but the titlebar has still a lighter color than the background color. By chance I discovered that if I set (void)awakeFromNib { self.window.titlebarAppearsTransparent = true; self.window.backgroundColor = [NSColor controlBackgroundColor]; /* I even tried the color [NSColor windowBackgroundColor] but the titleBar has still a lighter color. */ } (void)drawRect:(NSRect)rect {     [self.window.backgroundColor set];     NSRectFill(rect); } It works well for both light and dark mode on my macOS Big Sur 11.2. Will this work well on any macOS version? Even on Mojave and Catalina?
Mar ’21
Reply to Navigator and inspector behaviors on Xcode with BigSur
Yes, me too I have the same trouble. Xcode 12.4 on BigSur doesn't let us configure the Inspector status (open/close) within each TAB. Actually I can just set the Inspector open/close for all the TABs. And this is annoying especially when I have a TAB open on a XIB file and I need the Inspector open, then I have another TAB open on a code.m file and I need the Inspector closed. So now I spend a lot of time at opening and closing the Inspector every time I go from a code.m file to a XIB file and viceversa. I hope Apple address this issue on the next release. Should I file a bug/request/suggestion to Apple?
Feb ’21
Reply to NSMatrix within NSToolbarItem. Wrong space on Big Sur.
I have added [matrixGroup setTranslatesAutoresizingMaskIntoConstraints:NO]; [matrixGroup addConstraint:[NSLayoutConstraint constraintWithItem:matrixGroup attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:matrixGroup attribute:NSLayoutAttributeHeight multiplier:2.0 constant:0.0]]; and now the gap between the two buttonsCells has gone. Well. Anyway, when I display the toolbar with the icons only (without text), these NSMatrix(s) within the NSToolbarItem(s) look higher than the simple NSButtons within the NSToolbarItem(s). Why do the NSButton and NSMatrix behave differently when within the NSToolbarItem? Incidentally, the tooltips associated to each NSMatrix's buttonCell don't show up. I know NSMatrix has been deprecated, so, which object should I use to toggle between two buttons on the toolbar? I tried segments but they look smaller and flat.
Feb ’21
Reply to I set AVVideoCodecTypeAppleProRes4444 and I get a AVVideoCodecTypeH264 movie
I have just discovered the cause of the trouble. If I added a soundtrack to the movie, the 4444ProRes codec unexpectedly turned into an H.264 codec. So, I have just replaced [[AVAssetExportSession alloc] initWithAsset:videoAudioComposition presetName:AVAssetExportPresetHighestQuality]; with [[AVAssetExportSession alloc] initWithAsset:videoAudioComposition presetName:AVAssetExportPresetAppleProRes4444LPCM]; and now it works well. I can quite get a movie with 4444 ProRes codec and the audio tracks. The only point I miss now is that the AVAssetExportPresetAppleProRes4444LPCM is available on macOS 10.15+. Which preset could I use on macOS 10.13 ?
Jan ’21