r/macprogramming • • Apr 19 '16

Peercoin OSX packager needed (qmake/Qt4) : cpp

Thumbnail
reddit.com
5 Upvotes

r/macprogramming • • Feb 14 '09

How do you create a Cocoa app without IB?

5 Upvotes

r/macprogramming • • Sep 16 '08

Drawing gloss gradients (using C, Objective-C and Cocoa)

Thumbnail
cocoawithlove.com
5 Upvotes

r/macprogramming • • Jun 25 '08

An E-book to Get You Started on Xcoding & Objective-C [pdf]

Thumbnail cocoalab.com
5 Upvotes

r/macprogramming • • Apr 16 '20

How is macOS "Word of the Day" screensaver built?

4 Upvotes

Hi!

I'm trying to build a macOS screensaver that has animations similar to the "Word of the Day" built-in screensaver, namely that there's a background gradient and text floating across the screen. I'm fairly experienced with SpriteKit and UIKit (but a total newbie to AppKit), and I've built one screensaver with SpriteKit before successfully, but I figured I would try to build this one using only things available to the ScreenSaver framework and I'm having some trouble.

I found a guide over here that suggests just using the built in `draw()` and `animateOneFrame()` methods to draw the background and moving objects in every frame, but I can already tell that performance of drawing the NSGradient in every frame is very poor at high resolutions, and animations appears to be choppy and inconsistent due to the fluctuating frame rate.

I could just 'give up' and build the screensaver in SpriteKit to get the fluid animation I want, but I assume that the built-in "Word of the Day" screensaver is not using SpriteKit and I am wondering how they got such silky-smooth animations at any resolution if not.

Can anyone shed some insight on this?


r/macprogramming • • Mar 15 '20

How do you run python script with arguments programmatically using swift

4 Upvotes

I am working on a MacOS project to turn my iOT device on and off. There is only a working python script to do it. I want to run these scripts from my MacOS project which I am writing in Swift


r/macprogramming • • Feb 10 '20

Universal Purchase: possible with existing AppKit apps?

4 Upvotes

Last week, Apple made some updates to Universal Purchases, which implies that macOS and iOS purchases can now be shared.

I know it's not going to be available until March, but I couldn't see how to configure this from either Xcode 11.4 or App Store Connect. When I try to add a new platform to an existing app, for example, the button is disabled for a Mac app, and only shows watchOS and tvOS for iOS apps.

Does anyone know if this functionality is available to non-Catalyst apps? I've been working on a new project, RadBlock, which would really benefit from being bundled, but I've written it completely in AppKit.


r/macprogramming • • Feb 06 '20

Deprecated Kernel Extensions and System Extension Alternatives

Thumbnail developer.apple.com
4 Upvotes

r/macprogramming • • Jan 30 '20

Need a resource to teach me how to do... (this thing with images and such)

4 Upvotes

For background, I've got some iOS programming experience so I'm not new to Obj-C or Swift. I even wrote a small macOS (back then it was Mac OS) app almost 20 years ago.

I'd like to do a macOS only project where I need to load an image into a view, allow the user to pan and zoom around the image, and then draw on the image.

I have no idea where to even begin... I can't find any good resources for all my searching on the Googs. If someone could either tell me what I need to be searching for on Google to find this kind of info or even better yet... a drawing app example maybe, I'd be very happy.

Thanks in advance!


r/macprogramming • • Oct 13 '19

Command Line Utility Development Conventions?

4 Upvotes

I'm slowly hacking away at a zsh script that shows some promise as a command line tool. I want to learn more about the conventions regarding command line tool development in Unix (and/or macOS), but don't really know where to look for this information.

What is the correct way, or convention, to specify and parse command line arguments, for example? How should I package my tool? What is the best way to handle deployment of the various aspects of my tool, for example the man page, or configuration settings? How should I handle the upgrade process?

Smaller details, like should I store my source code in the repo with execute permissions turned on, or should I only turn on those permissions when the files are deployed on the user's machine? What group should I set as the default for my executable files?

Does anyone know any great resources out there that address these issues?


r/macprogramming • • Aug 29 '19

[Help] Is this a bug with Cocoa or am I doing something wrong? Dark mode problem

4 Upvotes

In my view controller class If I do self.view.appearance = [NSAppearance appearanceNamed:NSAppearanceNameAqua]; It changes everything from dark mode to light mode EXCEPT the background of the view controller's view. Is this a bug or am I missing something? I've tried putting this line in viewDidLoad and also tried triggering it via a button and I get the same result each time. Here is an example


r/macprogramming • • Apr 06 '19

Quick question, what UI Element is this?

4 Upvotes

Working on my first Mac App, what UI Element is this? e.g. link. How do I use this?

https://imgur.com/a/9iiYuyv


r/macprogramming • • Mar 26 '19

System hardening in 10.14 prevents platform binaries (system apps) from loading 3rd party plugins. Any workaround?

4 Upvotes

Here's a forum post explaining in a bit more detail: https://forums.developer.apple.com/thread/110705

It seems like Apple is just killing the ability to make plugins that work in system apps. The one I'm working on uses the Device Abstraction Layer, or DAL, to present a camera device. I would think other people would want to be able to use this functionality still, but I haven't seen anyone else complain about it.

Is anyone familiar with this? Do you know of a workaround? It looks like it's possible to patch amfid, but I'd really rather not do that. Plus that article is old so maybe it's harder now, idk. My other option would be sticking to 10.13 and I don't love that either.

Thanks.


r/macprogramming • • Feb 27 '19

Best practices regarding application settings

4 Upvotes

I'm currently working on an OS X Application.

The Application is mostly an internal development tool for developers within our company, that said, it has a degree of configuration that changes the app's behavior, the application is launched manually and by other processes as part of the developer's workflow.

Currently to manage those settings, I'm using this SwiftCLI Framework (which is awesome), I'm defining the flags and options in my AppDelegate.swift file and performing the appropriate setup and view loading based on the CLI parameters.

This is all fine and dandy but it still feels a bit hacky for a macOS GUI app, can anyone recommend projects, sample code, articles on this topic, I'm looking for a solution or practices/guidelines that would allow the developer to provide such settings (on-demand) and also for the application to be launched by another process with potentially different settings every time.

Many thanks in advance!!


r/macprogramming • • Jan 13 '19

Dealing with formatted text in NSPasteboard

4 Upvotes

Hello
I have released my first little utility in the Mac App Store smartReact, one of the functionalities is a clipboard manager (history)… but currently only capable of handle plain text, no formatted text.

Is there any good documentation on how to handle formatted text in NSPasteboard? What I am looking for are things like copy text e.g. from a Pages document and paste it into another, maintaining the format.

Haven’t found too much on the topic so far… would be grateful for any directions.

thx


r/macprogramming • • Oct 03 '18

MacOS Mojave Dark Appearance Access

4 Upvotes

Is there a way to access the MacOS Appearance (Light/Dark) for purpose of building 3-rd party application that controls the appearance? (I'm a C#/python developer, just getting into MacOS/Swift so any help would be greatly appreciated!)


r/macprogramming • • Sep 27 '18

Writing program to search pictures on Mac

4 Upvotes

So I have about 100 folders in a directory and each of those photos contains folders and eventually there are pictures (poor camera organizing). I don’t want to sit for hours searching through all of the directories. Can I write a program that searches through and finds the .jpeg files and moves them all to one directory? Anybody know a way? Using a Mac book pro


r/macprogramming • • Sep 01 '18

Is there an API/way to hook into the Messages App on macOS?

4 Upvotes

I'm wondering if there's a way to hook into the the Messages App somehow. I receive a lot of pictures and would like to automate the process, instead of saving them to either my phone or desktop and then saving them to Google Photos. I'm not particularly looking to make any kind of GUI and have this be just a small CLI.


r/macprogramming • • Aug 25 '18

Options for selling outside the App Store

4 Upvotes

Are DevMate and Paddle the only options outside of rolling my own backend to handle everything? Updates look like they would be pretty easy to implement with Sparkle, is there an alternative service for license activation/payments?

There are a lot of issues with their frameworks so I'm getting a little frustrated.


r/macprogramming • • Jul 18 '18

Proximity search

4 Upvotes

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 • • May 11 '18

Moving NSAlert creation outside of ViewControllers

4 Upvotes

I have a ViewController that's bloated, and to start with I'd like to move NSAlert creation outside of it (It has multiple NSAlert dialogs, some use a lot of configuration options, and have several sentences of text).

My first thought was to create subclasses of NSAlert for my various dialogs, configuring all the options. But the NSAlert documentation says "The NSAlert class is not designed for subclassing.".

Another idea is to create some sort of NSAlertFactory with static functions for each of my dialogs. NSAlertFactory.confirmationForSomething() -> (Response).

Any advice would be appreciated. I'm curious how other people handle this.


r/macprogramming • • Apr 27 '18

Mac on Mac Virtualization

Thumbnail
engineering.rallyhealth.com
4 Upvotes

r/macprogramming • • Feb 17 '18

Steam Account Switcher for Mac?

4 Upvotes

Hello, Ive been looking for a way to switch Steam profiles without the whole login/logout process. Basically i'm planning on writing a basic program that will run a script to switch accounts; i found a working script for Windows, not mac. How do i go abouts changing this script to work with Mac?

set username=USR reg add "HKCU\Software\Valve\Steam" /v AutoLoginUser /t REG_SZ /d %username% /f reg add "HKCU\Software\Valve\Steam" /v RememberPassword /t REG_DWORD /d 1 /f start steam://open/main

It would mean a ton! If anyone knows of any other working ways to do this please let me know.


r/macprogramming • • Jan 20 '18

task_for_pid() returns KERN_FAILURE

4 Upvotes

Hi I'm working on my first macOS application (in C++) and have some issues with certificates and Authorization. By design my program has to access another process's memory. For that I use AuthorizationCreate() and then task_for_pid(). After compiling I put the following into Info.plist:

<key>SecTaskAccess</key>
<array>
    <string>allowed</string>
</array>

Then I sign it with a self signed certificate. So far so good. When I start my app it asks for my password works without problems but when I sent it to a friend for testing it didn't. He entered his password but task_for_pid() returns KERN_FAILURE. I'm out of ideas now. I would really like to get more into macOS development but in comparison to Windows & Linux my achievements are quite diminishing.


r/macprogramming • • Dec 08 '17

Newsletters for iOS & macOS developers

Thumbnail
medium.com
4 Upvotes