How to write to Mac OSX preference files with mono C# - macos

Ii am looking for a guide and information to specifically reading from and writing to Mac OS 10.6, 10.7, and 10.8 preference files using preferably C# Mono. However I am by far and large not picky and can pick up any other language to do the same thing.
Yes this is probably a duplicate question, I just haven't had the time to research it myself. I am not "just wanting the answer handed to me" because honestly that is not going to teach me anything in the long run. Thank you for your help and suggestions ^_^
Edit: BTW, working 8-10 hour days makes it difficult to do much of anything else. I have done some searching on and off and while I have found sparse materials on coding preferences for Mac in the Mac docs and a couple tuts here and there, there still is not much in the way of Mono driven preferences specifically. I will be checking out the answer with MonoMac, thanks for the reply.

Is there an API in the Mac OS SDK to do this?
If yes, chances are that this API is wrapped by MonoMac, and then you can just use that.

Related

Macruby on OS X Mavericks

I'm running OS X Mavericks and installed MacRuby last week in order to make a simple app in it. Anything I try to run in Xcode (even Hello World app or a downloaded example), I always get "Build Failed" and really similar errors to this:
I found in some forums that th Garbage Collection is really deprecated etc. but I could't find any solution. Therefore I would be very glad if someone has a solution for this.
And no, I can't just work in Objective-C since it's far too complicated for me and apps I'd make :)
Thank you!
MacRuby isn't currently compatible with 10.9, not just because of the garbage collector, but due to changes in the Objective-C runtime, LLVM, and Xcode. There is a thread (titled "Mavericks and Macruby") going on right now on the macruby-devel mailing list about these issues. Joshua Ballanco's message especially sheds a lot of light on what it would take to keep MacRuby going.
You can still use the garbage collector by setting GCC_ENABLE_OBJC_GC = supported in Xcode; but as I said, it won't make MacRuby actually usable (yet).
I suggest people interested in cocoa in ruby help out refining the
cocoa gem instead of hoping for any progress on macruby which is
abandoned by its creators for commercial interests. The cocoa gem
is quite useful already, but need to mature a bit in some cases.
https://github.com/patrickhno/cocoa
DISCLAIMER: Yes I am the author.

How do I code applications on a Mac so that they use the native UI elements?

I'm starting to program. Already did some things with Java: a calculator, one document management system powered with a database and some other home projects. But I don't like the visual look. I love however how mi Mac's Apps look. And I want to create Apps for mac. Already buy one but when I open netbeans to program it looks like the Apps doesn't feel like mac.
Is there any specific java code to make the controls looks like how the other mac apps look? My dad mention something about Object C but I don't understand. Can someone please explain me.
AFAIK You'll never get the look and feel of Aqua (Mac's UI Kit) by using Java. Why? Because to make Java platform independent some things needs to get ripped off. And native controls are one of them.
I think you're taking about Objective C which is the native development language for building Mac Apps. I'll recommend you the book "Learn Objective-C on the Mac" is pretty useful.
P.S. I'll encourage you to start with iOS (iPhone and iPad apps). Why? Well, I think is easier to begin with. Things like fixed resolution and so on make your development efforts small while beginning with. (Just my 2 cents)
If you want to code in Objective-C, you'll first need to trek over to the App Store and download Xcode. This will install C/C++/Objective-C compilers on your Mac and then you can start getting your hands dirty.
Depending on what you are trying to accomplish, you can just google/read/learn and build your own frameworks from the ground up or look at something like Cocoa to get started as well.
http://developer.apple.com/technologies/mac/cocoa.html
Cocoa Frameworks
The Cocoa frameworks consist of libraries, APIs, and runtimes that form the development layer for all of Mac OS X. By developing with Cocoa, you will be creating applications the same way Mac OS X itself is created. Your application will automatically inherit the great behaviors and appearances of Mac OS X, with full access to the underlying power of the UNIX operating system. Using Cocoa with the Xcode IDE is simply the best way to create native Mac applications.
Good luck!
Apple has deprecated a lot of the Java support in OS X. It's possible to have a Java application integrated, but there are some annoying bits missing. See one of my questions demonstrating some issues with Java applications in the Dock. You would be better off using Objective-C instead, since Apple has lots of documentation and tutorials available.
You're thinking of Objective C. You can also do applications for Mac using C/C++ but as of late the "popular" language for Mac development is Objective-C. There are tons of tutorials and plenty of documentation to walk you through writing apps for both Mac and iOS.

What is happening to NCurses and OS X 10.6?

Apparently libncurses...dylib is broken OS X 10.6.3 relative to Mutt, and perhaps other applications, that use ncurses, although it works in 10.6 (as I can attest) and reportedly it works in 10.6.2.
Does anyone know if this is a bug or a feature in the view of Apple? If a feature, is there a workaround for people who want to upgrade 10.6..., but also want to use, for example, Mutt?
Thanks
As your post is pretty sparse in details, I guess you're talking about the bug in ncurses that breaks the way arrows works? (And may quit programs when you try to use the arrows, as a side effect)
I described it here: http://www.uponmyshoulder.com/blog/2010/os-x-10-6-3-broke-ncurses/
If we're talking about the same thing, I honestly think this is a bug. It doesn't match the documentation for ncurses, and actually makes no sense.
I submitted a bug report more than two weeks ago, without any answer from Apple so far.
A workaround (as suggested by Jonathan Groll) is to copy /usr/lib/libncurses.5.4.dylib and /usr/lib/libncurses.5.dylib from a 10.6.2 system. I don't really know what to think about such a libraries switch, as it might trigger other problems, but it does indeed fix this bug.
I've been told by Apple that my bug (ID #7812788) is a known issue currently being investigated by engineering, and has been filled as a duplicate of bug #7812932.
I'll keep you updated. :)

How can a Windows programmer be sufficiently productive on Mac OS X?

I've been using MacBook Pro for a few months at home, and I was wondering if there's a good book or guide that can help me be a better programmer on Mac. Maybe Mac-equivalent of Beginning Linux Programming. Note I am not looking for resource on how to program Mac application, instead I am looking for more general guide of using Mac for general development environment.
As a background, I am a Windows programmer by day. I've also done some Linux and BSD over the years, esp in school, like socket programming, graphics, make install type stuff. At home, I'll be doing Java, Scala, PHP, etc. on Mac.
So far, I've been using Eclipse, QuickSilver, and TextMate. VMWare Fusion, XCode and NetBeans are set up, but I don't use them. A DVI KVM switch is hooked up to real keyboard, trackball, and monitor. Recently stayed up till late fighting with MacPorts, and figured out I needed x86_64. The most struggle I had was configuring PHP. I don't know why they don't ship with MySQL and GD library. I eventually figured it out Googling around, and built the extensions from source. I have a feeling that I didn't get the memo and didn't read some basic guide on how to become a programmer on Mac, like how the whole architecture works. How can a Windows programmer be sufficiently productive on Mac OS X?
Related: Setting up a Mac for programmers
Edit: The specific type of application I want to develop doesn't really matter in my opinion. It could be Java, Scala, PHP as I mentioned or Cocoa, C++, or whatever.
What I am looking for is specific book, resource, advice on how to be more effective programmer on Mac, preferably something beyond "install XYZ".
Having converted from Windows to Mac OS X about five years ago, I often find myself thinking the same thing. I just cannot be productive on Windows (as much, I can be productive) as I can on Mac OS X.
To be honest, there are lots of small differences between Mac OS X and Windows. I find the biggest reason for people thinking like this (at it normally only applies to gamers and developers) is that they are trying to use the Mac like a Windows machine. You need to learn to accept that you have to use the command key, not the control key, etc.
It sounds like you are using a Mac because you have to as opposed to because you want to. It really is a much better platform than Windows once you get used to it.
I think a lot of Windows programmers come to Mac and don't try to learn it properly because they are complacent thinking they know it all because they have "used Windows all their life". I guess once you discover Spotlight, Expose, Mac OS X Keyboard shortcuts, etc. You will find your self being MUCH more productive that you ever were on Windows.... and its actually a fun OS to use.
Checkout some of the best Mac applications you can get here and here. You can also do a search for "top 100 mac apps".
Also, I noticed you were trying to setup some kind of web server directly into Mac OS X. It does ship with one, but if you are going to add MySQL and some other extensions I wouldn't go the MacPorts route. Get VMWare Fusion or VirtualBox (open source) and run the server in a VM. Much cleaner. I have a subversion/trac FreeBSD VM that handles my local version control.
I would like to add that if you don't presently use Xcode, you should definitely learn it and use it asap. It's a much nicer IDE to use than Visual Studio and it will make your life much easier.
Don't forget you have probably spent years on Windows help sites, you're going to a small degree need to do that with the Mac. Whenever you have a problem about using the Mac, ask a question on ServerFault. We are all more than eager to help you out.
Good luck.
You seem to want an overview of how Mac OS X works at a system level, more than recomenations about tools and so forth. If that's the case, I'd start with the (very basic) Mac OS X System Architecture Guide from Apple, then move on to Getting Started with Mac OS X, which should give you enough of an overview to get started.
It's not clear from your question what you intend to actually make with your programming time, but if you decide to persue Cocoa/OS X development, I recommend Cocoa Programming for Mac OS X by Aaron Hillegass.
I have a similar situation like yours. I use Windows for development and about a year back purchased a MBP for home (as I shifted to an office). I find it really difficult to get any real work done on my MBP. Somehow am used to the Windows environment with dual screens. But let that not stop you. A couple of software which I suggest you should get are:
Transmit - Good ftp client
MAMP - Runs a webserver nearly out-of-the-box. Good for basic development
Quicksilver - Helps in quick finding of applications
Spaces along with gestures (Configure your gestures to move from one screen to another, I use three fingers glide. its amazing)
Entourage - for email
Terminal - for ssh (putty alternative) (included)
Dreamweaver/BBedit/Textmate (all pretty decent. but i love editplus on windows. not a fan of IDE)
I assume your question is not about learning COCOA and more about being more effective using a MAC. Well, the above tools might help you.
Unfortunately, your question isn't very clear as to what you really want.
If you're looking to write anything cross-platform, it can be very helpful to have a virtual machine for testing. When in Linux, I've always used VirtualBox, and it works on OS X as well.
Also, as for choice of IDE, a lot of it comes down to your preference. Eclipse is nice because there's a plugin for almost everything for it. My experience with TextMate is limited, but my local Ruby Users Group swears by it.
Finally, a suggestion for not just Mac, but any platform really. Learn your hotkeys, set up new ones for things you commonly do, and use them frequently. Not having to take your hands off the keyboard to click a mouse through a few menus can really improve productivity. It may take a little time for them to grow on you, but once they become second nature, you'll wonder how you lived without them.
Basically, you can apply all your Linux/UNIX knowledge that you already have to the Mac. If you use the Terminal (/Applications/Utilities/Terminal.app) you can run all your favorite UNIX commands. Mac has a special command called "open" which is equivalent to the Windows "start" command (used to launch programs and files). You can also use "open -a" to open an application by name (e.g. "open -a Finder").
You might want to reconsider Xcode. Xcode opens more quickly than Eclipse and provides very good syntax highlighting, brace matching, block indenting, and more. Xcode doesn't have to be used as an IDE, you can also use it as a code editor, just like you are currently using TextMate.
For code editing (and everything else), try Aquamacs (http://www.aquamacs.org). It's a Cocoa-native build of Emacs, and it's brilliant for any programming task.

Getting started with Mac development

How long does it take for an experienced Windows programmer to learn writing simple software for Mac OS X?
Where does one start and what tools will be necessary?
THIS. I came from a Win32 API background programming lately a lot in C# and I was able to pick up on Objective-C and Cocoa very quickly by working through the book. You will be pleasantly surprised, the APIs are very rich and just wonderful. Reflection is a first class citizen which makes things very easy.
Xcode is of course free and available on your Mac OS X installation disk.
Edit: it took me about 2 weeks to come up to speed and write simple applications. I think this is because the language and API are easy to learn and use and Aaron Hillegass's book was a big help.
You might want to check this post for info - pretty much a duplicate question to this one. Definitely just go with Xcode and I think you'll find the Mac community pretty helpful - I have, at least.
Start by checking out the Apple Developer Connection. There's a lot of documentation there. OS X comes with all the development tools you need to get started, just install XCode from the OSX CD.
I would start here:
http://www.cocoadevcentral.com/
It's a great site with good resources on learning obj-c and cocoa.
This is also a great book:
http://oreilly.com/catalog/9780596003012/?CMP=AFC-ak_book&ATT=Learning+Cocoa+with+Objective-C
Well, first you get a hoodie and a smug sense of entitlement....
All kidding aside, the Aaron Hillegass book, a great idea, and the Apple doco are all you need to get started (oh yeah, and a Mac). I think the biggest barrier for me was figuring out Xcode since I come from a Visual Studio background.
How long it takes is a function of the level of your interest and your passion about your project.
The tools have come a long, long way since the days of Interface Builder in Mac OS X 10.0, that's for sure.
I guess the "how long" question would depend on what languages you are used to using.
In terms of reference material, I have heard good things about "Cocoa Programming for Mac OS X", and I'd love to have time to play with it for myself. Unfortunately, the day job takes up enough of my time. :)
CS193E (from stanford) is a nice course. Lots of material. Really understanding the use of class clusters, delegation, etc. takes some time, getting started does not.
"Step into XCode" is a great intro to the development environment; since the book works through taking a simple command-line linear regression program all the way to a fairly sophisticated application (Core Data, Spotlight importers, etc.), you'll learn quite a lot by osmosis.
It's the little things... On
Windows, I liked the PowerToy called
"Open Command Here" that allowed me
to open a DOS CMD window from
Explorer and automatically set the
current directory. On the MAC, I got
"On My Command" which allows you to
create simple macros easily, and
comes with a library of useful ones,
like "Open Terminal Here", "New text
File...", etc.
Install Eclipse. I loved using
Eclipse on Windows, and it works
great on the MAC, making me feel
right at home. I even found that
Eclipse has plugins for Perl and
ActionScript.
Learn Unix (if you don't know it
already). I had years of Unix
experience prior to programming
Windows, and it comes in handy.
Knowing Perl helps a lot as well.
I started my new position last
October, which was when I made the
switch from Windows to MAC. By March
I was fairly comfortable in my
understanding of things. Then again,
my development platform is AS2 and
AS2 in Flash, which is
cross-platform.
An alternative is to try out the Qt SDK, and write cross-platform applications that run on Windows, Mac and other platforms.
I started learning Qt when I joined Qt software, and it didn't take long for me to start writing simple software, even though I don't work as a developer.

Resources