It's certainly possible to develop on a Windows machine, in fact, my first application was exclusively developed on the old Dell Precision I had at the time :)
There are three routes;
- Install OSx86 (aka iATKOS / Kalyway) on a second partition/disk and dual boot.
- Run Mac OS X Server under VMWare (Mac OS X 10.7 (Lion) onwards, read the update below).
- Use Delphi XE4 and the macincloud service. This is a commercial toolset, but the component and lib support is growing.
The first route requires modifying (or using a pre-modified) image of Leopard that can be installed on a regular PC. This is not as hard as you would think, although your success/effort ratio will depend upon how closely the hardware in your PC matches that in Mac hardware - e.g. if you're running a Core 2 Duo on an Intel Motherboard, with an NVidia graphics card you are laughing. If you're running an AMD machine or something without SSE3 it gets a little more involved.
If you purchase (or already own) a version of Leopard then this is a gray area since the Leopard EULA states you may only run it on an "Apple Labeled" machine. As many point out if you stick an Apple sticker on your PC you're probably covered.
The second option is more costly. The EULA for the workstation version of Leopard prevents it from being run under emulation and as a result, there's no support in VMWare for this. Leopard server, however, CAN be run under emulation and can be used for desktop purposes. Leopard server and VMWare are expensive, however.
If you're interested in option 1) I would suggest starting at Insanelymac and reading the OSx86 sections.
I do think you should consider whether the time you will invest is going to be worth the money you will save though. It was for me because I enjoy tinkering with this type of stuff and I started during the early iPhone betas, months before their App Store became available.
Alternatively, you could pick up a low-spec Mac Mini from eBay. You don't need much horsepower to run the SDK and you can always sell it on later if you decide to stop development or buy a better Mac.
Update: You cannot create a Mac OS X Client virtual machine for OS X 10.6 and earlier. Apple does not allow these Client OSes to be virtualized. With Mac OS X 10.7 (Lion) onwards, Apple has changed its licensing agreement in regards to virtualization. Source: VMWare KnowledgeBase
There is no stack trace in the output you showed. The addresses you see are the objects' own addresses, not function pointers, and the hex numbers next to the punctuation characters are simply the hex dump of the data.
To find out where the object was allocated from, set MallocStackLogging in leaks's environment:
% MallocStackLogging=1 leaks …
You may also want to use the -nocontent option, which will suppress the hex dump. Don't use this all the time, however: Sometimes the hex dump contains a valuable clue.
Also, leaks is not necessarily telling you that you have three leaks; to be precise, it's telling you that you have three leaked objects. The deliberate leak you showed produces only one leaked object, but a different leak (such as in a loop or frequently-called method) may leak many objects.
Edit: BTW, some of those leaks are from SIMBL or one or more of your SIMBL plug-ins. Turn off SIMBL and any other input manager hacks before leak-hunting. Remember, that code runs in your process; moreover, leaks doesn't care whose code allocated or leaked the memory, only that it's leaked, so it will show the leaked object regardless of who allocated or leaked it.
Best Solution
When you set the property
playerName
, it automatically retains theNSString
(even though its constructor autoreleases it). So you'll have to release it again at some point (preferably in thedealloc
method).When you assign a value to a property declared with the retain flag, as in
@property(retain)
, then whenever you assign a value to that property it does three things: releases the old value, assigns the variable to the new value, and retains the new value. Thus the string you're creating throughstringWithUtf8String:
has a retain count of 1 after that line is executed.You'll have to release this string at some point, or you'll get a leak. Since it's a property, however, it shouldn't be released before the object that contains it is, so you should put that release statement in your
dealloc
method.If none of this really makes sense, take a look at the memory management guide Alex linked to.