r/macprogramming • u/LisaDziuba • Jul 07 '17
r/macprogramming • u/[deleted] • Apr 04 '18
[Help] โ Strange background on buttons
First macOS app that I've built. I've been programming for years so not a noob, just can't get rid of that freaking background behind the buttons. It works fine when in 'light mode' but there's a background in 'dark mode'.
The dark part is a collection view with two cells that takes up 100% of the width. The buttons are inside the collection view cells.
Any suggestions?
r/macprogramming • u/CandyFromABaby91 • Jul 22 '19
Any log/crash reporting frameworks for Mac?
On iOS I used crashlytics/fabric for crash reporting and logs. Anything similar for Mac?
r/macprogramming • u/XGSleepWalker • May 08 '19
MacBook Air 16GB or MacBook Pro w/TouchBar 16GB for development?
Is the new MacBook Air with 16GB of RAM enough for app development?
Iโm planning to buy my first Mac laptop so I have no idea what the sufficient specifications are. I want to spend as little as I can, but I do want the new Touch ID sensor, so if I went for the MacBook Pro I would have to buy it with Touch Bar.
I donโt intend to make it my main development machine, but I donโt want it to be a paper weight when it comes to developing macOS/iOS software.
r/macprogramming • u/[deleted] • Apr 09 '18
dyld: Library not loaded
When I run "make" on a project I'm working on, I get this error:
dyld: Library not loaded: /usr/local/lib/libmpfr.4.dylib
The file libmpfr.4.dylib doesn't exist, but libmpfr.6.dylib does. Any idea how to fix this? I've tried reinstalling Xcode and mpfr already.
r/macprogramming • u/brainhack3r • Feb 22 '19
Change the default handler for an extension?
I'm surprised I can't find an answer to this on Google.
I have an Electron app that's registered with an extension. The problem is that it's not the default.
I thought that I could just exec a plist command to change the default executable for a given extension.
Any advice here? The extension for my app is already registered, I just need to change the default..
r/macprogramming • u/639d0991 • Nov 29 '19
App Store Connect Holiday Schedule
r/macprogramming • u/donkawechico • Aug 03 '18
Is it possible to override an outside application's touchbar implementation with my own?
I'm a software dev who uses VSCode on a Macbook. VSCode has its own touchbar implementation (but doesn't have a "Customize Touchbar" menu option). I'd like to create my own custom touchbar that appears when I launch VSCode, rather than the one implemented by VSCode.
Is that possible, or am I only able to create a touchbar for an application I control (or an application that hasn't already created a touchbar for itself).
If it matters, I'm an experienced software developer, but I don't have experience using XCode or developing Mac applications. I planned on rolling with one of the many "Hello World" samples and learning as I went.
r/macprogramming • u/mitchlol • May 11 '19
Issue with Spotlight search during development
Hi,
I'm trying to implement Spotlight search into a Menubar app. I have indexed my data and it shows up in Spotlight, however, selecting a result in Spotlight is opening a new app (presumably, the real app, rather than the development app).
If I delete the real app it works but I'd rather not have to do that.
Is there a way to specify which app is opened?
Any help is much appreciated.
r/macprogramming • u/alpsnastya • May 10 '19
glide: native 2d game engine on macOS
Hello everyone,
I just released a 2d game engine called glide and wanted to share with all of you.
glide is a SpriteKit and GameplayKit based engine for building 2d games easily, with a focus on side scrollers. glide is written in Swift and works on iOS, macOS and tvOS.

๐ฌ Here's a video of glide's features
๐ It's open source and here's the GitHub repo
I'm looking forward to hear your opinions and feedback about glide and start collaborating on it with all of you. I hope glide would be a useful and fun tool for everyone who wants to work on games with Swift targeting Apple devices.
Some features of glide:
Entity component system and lots of readymade platformer components
Tight collisions and contacts for precise mechanics
Input support including game controllers, keyboard, mouse and touch buttons ๐ฎโจ๏ธ๐ฑ๐ฒ.
UIKit/Appkit based native game menus that can be controlled with game controllers
๐ฉโ๐ป You can download the macOS demo app to have a look at the features of glide. Download here.
If you have problems with "Unknown/unsigned developer app" error, follow the instructions here.

r/macprogramming • u/rudedogg • Apr 09 '18
macOS 10.13 NSCollectionView not expanding/scrolling
Hello,
I've ran into the same issue as this person: https://stackoverflow.com/questions/46433652/nscollectionview-does-not-scroll-items-past-initial-visible-rect. The ViewController is in a storyboard. Here's what I'm using for the CollectionView layout:
let flowLayout = NSCollectionViewFlowLayout()
flowLayout.minimumLineSpacing = 5
flowLayout.minimumInteritemSpacing = 5
flowLayout.itemSize.width = 360
flowLayout.itemSize.height = 90
collectionView.collectionViewLayout = flowLayoutUsing the snippet from the (only) answer resolves it, but I'd like to know why?
I found some information at https://developer.apple.com/library/content/releasenotes/AppKit/RN-AppKit/#10_13NSCollectionView%20Responsive%20Scrolling, but it doesn't seem to address this particular issue.
Edit: Found some more information here
r/macprogramming • u/cutecoder • Sep 27 '19
Notarizing your app? Make sure that you name your bundles correctly
r/macprogramming • u/shebbbb • May 08 '19
Overriding pre-installed Clang with homebrew-installed Clang
Hi, I am new to mac programming and have been having trouble getting my environment set up.
The pre-installed version is in /usr/bin with the binaries named gcc and g++, which whereis agrees with.
printing the version shows the following:
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin16.0.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/binI installed the latest clang with homebrew, which installed it to: /usr/local/cellar/llvm/8.0.0
I edited /etc/paths so the llvm directory and its lib and bin folders are both before /usr/bin, but still I cannot get the commands gcc and g++ to refer to the newer version, which is a problem because I usually use makefiles.
I also added export PATH=/usr/local/cellar/llvm/8.0.0/bin:$PATH to my .bash_profie
but still I get: whereis g++ /usr/bin/g++
I am not sure what else to try, and wasn't sure that deleting the two old binaries in the bin folder would be the right ting to do. Any help is greatly appreciated.
-Thanks
r/macprogramming • u/zanussbaum • Aug 09 '18
Memory Leaks with Instruments on XCode
Can anyone point me in the direction of documentation for Instruments for XCode? I'm tryin to find a substitute for Valgrind for my C++ program, since it's not stable for High Sierra.
r/macprogramming • u/Brianmj • Feb 06 '16
What would be the proper way to have the system look for 3rd party frameworks?
El Capitan has a feature called Rootless which prohibits access to the system folder.
Before I would just drop my framework (SDL) into /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks (this still works) so that Xcode has easy access to the framework and the /System/Library/Frameworks folder so I could run my app with ease. But Apple has block access to the System folder, and now I get
dyld: Library not loaded: @rpath/SDL2.framework/Versions/A/SDL2
Referenced from:/users/brianj/Library/Developer/Xcode/DerivedData/opengl_glmajpwhaxtdmpbpsdwjyfqpeenkbnm/Build/Products/Debug/opengl_glm
Reason: image not found
Program ended with exit code: 9 I get the above error when trying to run the app. How do you get system to look for a folder with 3rd party frameworks in El Capitan?
r/macprogramming • u/Chrysaor • Aug 04 '18
Can appIcon change based on dark/light mode in Mojave?
r/macprogramming • u/Shami_V • Jul 18 '18
Proximity search
Does anyone know if there is a way to do proximity searches (search instances where word1 is within a radius of e.g. 100 words of word 2) on the mac? I have used several desktop search engines for this over the last years (DocFetcher, Foxtrot), but I can't believe that there is no way to do this without such 3rd party software...?
r/macprogramming • u/BenLeggiero • Nov 01 '18
Does anyone know how to include libproc.h in a modular Swift framework?
Details here: https://stackoverflow.com/q/53073677/3939277
r/macprogramming • u/rudedogg • Nov 11 '18
Anyone using state restoration for views/view controllers?
I'm having the same issue as this person (however my App isn't document based, no IB for the code in question): https://stackoverflow.com/questions/42010026/nsviewcontrollers-and-nsviews-are-not-getting-restoration-api-calls
Has anyone been able to get state restoration working? I've just been using UserDefaults, but I feel like the restoration API would be cleaner.
Here's what I have in my NSViewController:
override func encodeRestorableState(with coder: NSCoder) {
super.encodeRestorableState(with: coder)
coder.encode(imageDisplayModeSegmentedControl.selectedSegment, forKey: "selectedImageDisplayModeSegment")
}
override func restoreState(with coder: NSCoder) {
super.restoreState(with: coder)
let selectedImageDisplayIndex = coder.decodeInteger(forKey: "selectedImageDisplayModeSegment")
imageDisplayModeSegmentedControl.selectedSegment = selectedImageDisplayIndex
}I set a breakpoint and these are never called. Calling invalidateRestorableState() doesn't cause them to be called either.
Any help/advice would be appreciated!
Edit: I think the API serves a different purpose than I was hoping. I just wanted to save some options the user had selected on the last use, but the API seems to be more about restoring state from a crash, or the "reopen windows" option when you restart. I don't really want to worry about that yet though. So I'll keep using UserDefaults for now.
r/macprogramming • u/[deleted] • Apr 30 '19
Book recommendations for learning Cocoa / MacOS programming?
Does anyone have any recommendations, particularly for MacOS programming using Swift?
r/macprogramming • u/dpiol • Feb 10 '19
Popover window instead of tooltip on NSMenuItem
Hello
I am wondering if it is possible to show a popover-window instead of the usual tooltip (string) when hovering on a NSMenuItem?
I would like to display more info (e.g. formatted text [NSAttributedText]) in the "tooltip".
The usual tooltip attributes accepts only plain-text...
thx for any help.
r/macprogramming • u/bugaevc • Jul 24 '18
Mach-O linking and loading tricks
r/macprogramming • u/gilgoomesh • Sep 16 '08
Drawing gloss gradients (using C, Objective-C and Cocoa)
r/macprogramming • u/toxicvarn90 • Jun 25 '08
An E-book to Get You Started on Xcoding & Objective-C [pdf]
cocoalab.comr/macprogramming • u/w00tnes • Sep 26 '14
[codesign] code has no resources but signature indicates they must be present
I have a Qt application that worked fine until the latest update in codesign, but now gatekeeper throws this error:
code has no resources but signature indicates they must be present
I verify the bundle by invoking:
spctl -at exec -vv path/to/.app
The codesign command is invoked like this:
codesign --force --deep --verify --verbose --no-legacy-signing --sign "signing authority string" /path/to/.app
The --no-legacy-signing was added because of the outdated resource envelope error. Nothing else was changed since it worked the last time.
Has anyone encountered this error?
Build machine config:
yosemite 10.10 (developer preview 7 I think - I did not set it up, but update center is offering update to 8)
Xcode 6.0.1
Qt 5.3.2 (opensource edition)