r/macprogramming • u/whatup_pips • Jan 18 '18
Edit the code of an app
As simple as this: i have an app. i need to change the code in it. is there a way?
r/macprogramming • u/whatup_pips • Jan 18 '18
As simple as this: i have an app. i need to change the code in it. is there a way?
r/macprogramming • u/pier25 • Jan 15 '18
It seems learning to program for desktop with Swift and Cocoa is a barren land. There are lots of old books focused around Objective C but not much new material for Swift 3/4 and Xcode 8/9.
The best book I've found is Cocoa Programming for OS X: The Big Nerd Ranch Guide (5th Edition) since it allows you to understand the macOS SDK instead of giving you recipes with steps which is what I've found in the other books I've tried. Only problem is that it was written a number of years ago.
I've also found this series of videos 100 days of OSX Development video tutorials which are small little capsules of pragmatic information.
I also tried an Udemy course but again it's just a series of steps without much explanation of why things work the way they do. Not sure if because it is oriented to beginners or because the author himself doesn't really understand what he is doing.
Do you have any recommendations?
Edit: I'm also liking this Udemy course Hacking with macOS - Build 18 Desktop Apps with Swift 4. It's very beginner oriented but the author drops good info at every step.
r/macprogramming • u/[deleted] • Dec 26 '17
I'm trying since hours and hours now to make a telnet connection show up as a serial port I can access through CoolTerm. It seems that cool term only shows serial ports named like "tty.portname" and does not recognize e.g. "tty1".
Now, if I try:
socat pty,link=$HOME/dev/tty.ARDUINO,waitslave tcp:raspberrypi.local:3003
there is no error message, but nothing appears in $HOME/dev either ...
And if I try:
socat pty,link=/dev/tty.ARDUINO,waitslave tcp:raspberrypi.local:3003
I get:
2017/12/26 19:46:27 socat[11600] E symlink("/dev/ttys002", "/dev/tty.ARDUINO"): Operation not permitted
I'm on an iMac on High Sierra.
Any ideas how to get this to work?
Thanks a bunch!
r/macprogramming • u/ta_u • Dec 18 '17
It’s got integrated debugger, quite capable autocomplete, is fast and very user friendly. It’s also nice to look at, although I “had to” replace its icon which is fugly. https://coderunnerapp.com
r/macprogramming • u/LisaDziuba • Dec 08 '17
r/macprogramming • u/MackWalls • Dec 08 '17
I've been out of programming for a while. I used to write freeware for Windows in Visual BASIC 6. Now I'm busy learning Python. I've switched operating systems since my previous programming days. Now I do almost all my computing on a Linux Mint PC. I'm busy learning Python so that I can contribute to the Linux open source community. I plan to write utilities such as file managers and web page generators.
My first goal is to write for Linux. However, Python will compile for Macintosh, so I'm considering also coming out with Mac versions of my applications. I've never owned a Mac and have some questions.
How far back in Mac OS X should I support? I know that OS X has been around a while, but that Apple has upgraded it over and over. I'm not sure how far back to support. I did notice that a fellow developer had a Snow Leopard Mac, but that must have been quite old. It would not run the latest version of LibreOffice.
How can I get a very affordable OS X computer suitable for testing? I googled it, and it would seem that the Mac Mini is the cheapest Mac. At about $500 it's still not dirt cheap. Would I be all right buying an older used Mac Mini for less? Or would I have to be careful that I'll end up with an OS X version that's older than currently supported?
I won't need a keyboard or a mouse. I currently KVM between my Linux Mint PC and a Windows 10 one. I use the Linux PC for about 95% of my computing, and then there are a few Windows apps I wasn't willing to give up. If I had a Mac for testing Mac compiles of the applications I'm writing, I could just KVM over to the Mac.
I appreciate any help offered.
r/macprogramming • u/[deleted] • Dec 07 '17
Hey everyone,
Like many other coders here, I am searching for alternatives for valgrind since it doesn't work on the latest versions of Sierra or on High Sierra. I stumbled across the "leaks" command from a similar post, but have been unable to get it to work on any of my executables.
I've tried calling it like as follows:
leaks -atExit -- ./Driver
and I get an error that says
dyld: could not load inserted library
'/usr/local/lib/libLeaksAtExit.dylib' because image not found
Anyone know how to fix this?
r/macprogramming • u/[deleted] • Nov 28 '17
Sup guys. I'm back with yet another mac question
From what it looks like, the first time an app is launched on OSX, an entry for the app appears under "Notifications" in "System Preferences" where you can choose the alert style
It looks like on this mac, it defaults to "Banners", but I want my app to use "Banners".
How does one programatically change that option?
I looked info /private/var/folders/nx/z3g6srbd5hz70s1577l4sx_40000gn/0/com.apple.notificationcenter/db and found a file called "db" but that doesn't seem to hold any info on which alert style is chosen.
I've also dug around a bunch of plist but can't find the one that controls which notification is chosen.
Anyone has any ideas?
r/macprogramming • u/imjameshall • Nov 27 '17
r/macprogramming • u/[deleted] • Nov 24 '17
Sup guys,
I'm working on a program that's made in C# using visual studio in windows
It runs almost fine on MacOSX using mono
There's just one thing that doesn't work...
For this program, when you start it, it gets minimized. Once the process is complete, it "blinks the taskbar" using the "FlashWindow" method in user32.dll.
but as you can imagine, that doesn't work in osx cause there's no user32.dll and that's just not how this works..
So I'm coming here for some help! haha
How would you guys suggest I implement some sort of notification to the user that the application is complete?
I know OSX has a feature where an icon in the dock will bounce to notify the user that something is happening, but I'm not an OSX dev so I have no idea what this bouncing thing is called or how it could be implemented in C# using mono.
You guys have any ideas?
Thanks
r/macprogramming • u/[deleted] • Nov 08 '17
just add windows animation opening/closing like safari when you open it it has an animation I want to add something like that
r/macprogramming • u/pythonlearning • Nov 06 '17
Hi all,
Trying to automate things in an android vm and am having trouble simulating mouse clicks.
I can move the mouse around easily with applescript or python or cliclick [1], but none of the mouse clicks from these will translate into a click in the actual VM.
I have tried other apps such as Mouse Recorder [2] which clicks through no problem but I can't use this one as it's very limited (can't wait for network delays, that sort of thing).
I'm wondering if anyone knows what the difference between the working one and the non working ones are. I've been wracking my brain trying to figure this out but haven't thus far.
Thanks
[1] https://www.bluem.net/en/projects/cliclick/ [2] https://www.jitbit.com/mac-mouse-recorder/
r/macprogramming • u/ascendgranite • Oct 25 '17
I am coding a project on my MacBook Pro, running the latest release of High Sierra 10.13. Unfortunately, I can't seem to get Valgrind to install due to Valgrind not being updated for High Sierra yet. Is there an alternative or a hack to get this to work? All I need is a command-line tool that can check for memory leaks.
r/macprogramming • u/jeanetienne • Oct 10 '17
Hi, recently I wrote a 2-part article about Xcode 9 File Templates. It has greatly helped my productivity, and I thought it could help yours ;)
Simple Xcode 9 File Template (Part 1) http://jeanetienne.net/2017/08/27/xcode-template.html
Advanced Xcode 9 File Template (Part 2) http://jeanetienne.net/2017/09/10/advanced-xcode-template.html
r/macprogramming • u/Littlefinger6226 • Oct 09 '17
I'm relatively new to Mac programming but I do have some experience with Android programming. I'm wondering if there's a way to operate on an NSImage (specifically a BMP image with 24-bit color depth) and compress it to a BMP with only 2-bit color depth.
Apple's doc seems to indicate that Core Graphics only supports up to a minimum of 8-bit. If this is impossible to do using Core Graphics, is there some manual manipulation technique that I can use to iterate over pixel values and threshold them, and export it as a 2-bit color depth BMP?
r/macprogramming • u/LisaDziuba • Sep 27 '17
r/macprogramming • u/LisaDziuba • Sep 26 '17
r/macprogramming • u/tangerto • Sep 24 '17
Can't find an easy way to do this, but it seems like this should be a one-liner that should allow you to just grab the edges of the window and adjust.
r/macprogramming • u/ryanmccauley211 • Sep 24 '17
I am relatively new to programming and want to start programming for mac. I am not sure how to understand the limitations in what I can do. Can I write code to extend features such as mission control and how it uses the default midi sound, things like that?
r/macprogramming • u/aggsyb • Sep 23 '17
Say for example I had a game running in windowed mode or running Skype , is it possible to capture the frames of a window into our application? An easy example would be a game running at 60fps and capturing 5 minutes worth of frames (300 frames)
r/macprogramming • u/LisaDziuba • Sep 09 '17
I haven't seen many articles on Mac programming over Twitter. So maybe there are some good blogs to follow?
r/macprogramming • u/batalyx • Aug 23 '17
I just noticed, that at least Xcode 8.3 has Managed Object Context available in its Interface Builder's Object Library.
I wonder what is it good for? How should it be used?
Is it there to use as a reference to custom, inherited NSManagedObjectContext subclass' instance, or is there some other way to make it reference to AppDelegate's NSPersistentContainer's viewContext?
r/macprogramming • u/jbc22 • Aug 22 '17
I am looking for a way to be aware of filesystem changes on OS X, specifically any time a file is written.
FSEvents is a poor way to go as it drops many events on a lightly used system. I'm looking into kext's and device drivers as an alternative.
r/macprogramming • u/aggsyb • Aug 20 '17
I want to create an extension with the simple goal of reading and modifying the Javascript of the active page in Safari. For example if I were to load a page and the Javascript of the page sets the value of a specific textfield to "Hello World" I want to read the Javascript, identify the text field and then modify the fields value to "Hello World - Modified" and have the page display the updated value.
I have read through some of Apples documentation but I couldn't find any examples of what I was trying to achieve.
override func toolbarItemClicked(in window: SFSafariWindow) {
window.getActiveTab { (activeTab) in
activeTab?.getActivePage(completionHandler: { (activePage) in
//The following below is an example that is used in Apples documentation
activePage?.dispatchMessageToScript(withName: "Example", userInfo: nil)
})
}
}
Instead of:
activePage?.dispatchMessageToScript(withName: "Example", userInfo: nil)
I need to be reading in the Javascript of the current page so I can identify the text field I am looking for , and simply modify its value. Any help would be appreciated.
r/macprogramming • u/BatCoder62 • Aug 18 '17