mac

Sending a message to nil?

As a Java developer whom is pouring over Apple's Objective-C 2.0 documentation: I am in a state of wonderment as to what sending a message to nil means - let alone how it is actually useful. Taking an excerpt from the documentation: There are several patterns in Cocoa that take advantage of this fact. The value returned from a m...

How can I determine the running Mac OS X version programmatically?

Hi everybody, I have a program which needs to behave slightly differently on Tiger than on Leopard. Does anybody know of a system call which will allow me to accurately determine which version of Mac OS X I am running. I have found a number of macro definitions to determine the OS of the build machine, but nothing really good to determi...

Looking for MacOS Threaded Networking sample code

My code needs to run all networking routines in a separate NSThread. I have got a library, which I pass a callback routine for communication: my thread code library my callback (networking) library my thread code My callback routine must POST some data to an HTTP server (NSURLConnection), wait for the answer (start a N...

How do I make the apple terminal window auto change colour scheme when I ssh to a specific server

When I ssh into a remote production server I would like the colour scheme of my terminal window to change to something brigh and scary, preferably red, to warn me that I am touching a live scary server. How can I make it automatically detect that I have ssh'ed somewhere, and if that somewhere is on a specific list, change the colour sc...

How can I make a program start up automatically in OSX?

I have a little program that I want to make open automatically when my mac is started up. Because this program accepts command line arguments, its not as simple as just going to System Prefs/Accounts/Login items and adding it there... From google, I read that I can create a .profile file in my user's home folder, and that will execute ...

Can you recommend books for getting started with Web Development on a Mac?

As a dyed in the wool Windows dev I surprised myself bought a Mac and I feel such a beginner again. I'm basically looking to get up to speed quickly and need advice on making the transition as an experienced windows dev to OSX. Can you recommend any development books specifically in the area of getting up and running using Apache, Pytho...

Best Way To Get Started With Mac Development

I just recently got my first mac. I do lots of programming on windows but now I want to get into Mac development. What are some languages i should know or tools i should use to get started with mac development? ...

What's a good book for learning Cocoa and Mac programming?

I'm looking for the book for an experienced developer wanting to learn Cocoa. ...

Emacs on Mac OS X Leopard key bindings

I'm a Mac user and I've decided to learn Emacs. I've read that to reduce hand strain and improve accuracy the CTRL and CAPS LOCK keys should be swapped. How do I do this in Leopard? Also, in Terminal I have to use the ESC key to invoke meta. Is there any way to get the alt/option key to invoke meta instead? update: While the control ke...

Installing RMagick on Mac OS X with MacPorts

With the MacPorts version of ImageMagick 6.4.4 installed, I'm getting an error installing the RMagick gem. /opt/local/bin/ruby extconf.rb update rmagick checking for Ruby version >= 1.8.2... yes checking for /usr/bin/gcc-4.0... yes checking for Magick-config... no Can't install RMagick 2.7.0. Can't find Magick-config in /System/Libr...

Help localizing application in Mac

Hi, I have an application which is supposed to work on both windows and Mac and is localized in Portuguese, Spanish and German. I have an ini file from where the localized strings are read from. But the ini file doesn't work with same encoding for the files on both platforms. For Windows I have to have the file in ANSI format or else t...

Java Development on a Mac - Xcode, Eclipse, or Netbeans

I've been using Xcode for the usual C/C++/ObjC development. I'm wondering what are practical considerations, opinions of Xcode, Eclipse or NetBeans usage on a Mac for Java development? Please don't include my current usage of Xcode in your analysis. ...

USB Driver Development on a Mac using Python

I would like to write a driver to talk to my Suunto t3 watch in Python on a Mac. My day job is doing basic web work in C# so my familiarity with Python and developing on a Mac is limited. Can you suggest how one would start doing driver development in general and then more specifically on a Mac. I.e. how to easily see what data is being...

Change Sound (or other) System Preferences in Mac OS X

I'd like to be able to switch the sound output source in Mac OS X without any GUI interaction. There are tools to do control the sound output, such as SoundSource and an applescript to open the preferences dialog. What I am looking for is something that switches the preference instantly, like SoundSource but it has to be scriptable. T...

What network names/addresses does Mac OS X server support out of the box?

Does someone know all the correct names, syntax for ways to locate an OS X server (without adding non-Apple software)? From what I can tell, you have: Network Interface address: 00:19:e3:aa:aa:aa IPv4 address: 11.22.33.44 IPv6 address: 3ffe:3ffe:3ffe:3:200:f8ff:fe21:67cf Domain name: myserver.fqdn.com. AppleTalk Comp...

What's the best way to find out the installed version of the iPhone SDK?

What is the easiest way of finding out what version of the iPhone SDK is installed on my OS X? When you log into the Apple's iPhone Developer Center, you can see the build number of the current available version of the SDK, but you have to remember if you have already downloaded that version or not. What is the easiest way of staying ...

Test a site in Mac Firefox

I need to test a site with a dynamic menu in Mac Firefox, but I'm running in Windows. A simple browsershot.com test won't help; I need to actually use the site. How can I acquire a method of doing Mac emulation without physically having a Mac? Is there some kind of remote VM product out there? ...

What is the best way to solve an Objective-C namespace collision?

Objective-C has no namespaces; it's much like C, everything is within one global namespace. Common practice is to prefix classes with initials, e.g. if you are working at IBM, you could prefix them with "IBM"; if you work for Microsoft, you could use "MS"; and so on. Sometimes the initials refer to the project, e.g. Adium prefixes classe...

Skype & Terminal Services information exchange?

We have sales reps who access our 'system' via terminal services. In our system we would like to enable clicking the number of a client and launching skype on their local machine not in the terminal services session. We see two potential ways of this working... Clicking on a URL ( eg skype:01234569?call ) and it works locally but we ...

How do I create a sparse file programmatically, in C, on Mac OS X?

I'd like to create a sparse file such that all-zero blocks don't take up actual disk space until I write data to them. Is it possible? ...