Saturday, October 30, 2010

An Introduction to Memory Management in Objective-C pt.1

Hello everyone! This is my first post on this blog and I hope you enjoy it.


On this post I will introduce the concepts behind memory management in Objective-C. This will be the first of a serie of posts about memory management, where I intend to cover everything you need to know to be confident with pointers in Objective-C. :)


Ownership


To understand memory allocation in Objective-C, we must first understand Ownership. Ownership principle states that for each object one creates, one is the only responsible for destroying it. If one doesn't destroy it, then there will be a memory leak. And if someone else destroys it, then there will be bugs, crashes and all sorts of unexpected behaviors due to invalid references being used.


In practice, the Ownership principle states that for each new there should be a delete on a C++ code, for example.


This principle is implemented on compilers via reference counting. For each allocator call, the reference count of an object is incremented and for each destructor call this reference count is decremented. When the reference count reaches 0, the memory space is cleared and set as available for other allocations.


In Objective-C, there are 4 keywords for allocators: alloc, new, copy, retain and 2 for destructors: release and autorelease.


I will explain each one on the next post.


Stay tuned for more!

Thursday, October 28, 2010

Lab1 Video

Hello,

This is the first Lab about ObjectARX for Mac programming. In this Lab you will learn how to create a new project inside XCode, how to compile and build it. At the end, you will learn how to debug the application using XCode debug tools.



If you have any problem watching the embedded video try the following link:

YouTube Link

Cheers!
Fernando.

Wednesday, October 20, 2010

Behind the Scenes: Bringing AutoCAD® to the Mac®

Hello,

Here is a short video with some Autodesk people and some beta users talking about the challenges faced to develop AutoCAD for Mac.

Behind the Scenes: Bringing AutoCAD® to the Mac®

I would like to thank you all Autodesk members for the effort and support helping us (OFCDesk) to accomplish our hard job to port OFCDesk IDC to the Mac platform.

Regards.

Monday, October 18, 2010

ObjectARX® SDK for Mac® available

Hello,

Autodesk has just posted the very first release of ObjectARX for Mac. It can be downloaded from the ObjectARX official website:

ObjectARX®

The SDK is a dmg package which will install the necessary Header and Sample files into your Mac.


It will also create some XCode Project Templates which will create the ARX/DBX application skeleton.

Once you run your XCode and start to create a new Project you will see two new Project templates. One is for a ARX Cocoa module and the other for a DBX module.



The Template will initialize an empty dummy project with a basic command registered and ready to receive your code. On this first release, there are no Project Class wizards like you are used to have inside Visual Studio.



There are also some online documentation available with a Developer Guide and also a Migration Guide:

Developer Documentation

The documentation is posted at Wiki style so it is very interactive with rich content like Videos.





Stay tuned because now I will be able to further explore this technology in details.

For now, make sure your have your AutoCAD for Mac, XCode and ObjectARX for Mac installed into your OSX.

Regards.

Friday, October 15, 2010

AutoCAD® for Mac® Trial available

Hello,

AutoCAD® for Mac® is now available for download as a 30-day Trial.

Download now

I strongly suggest you go ahead and start to playing with it. As soon as the ObjectARX for Mac SDK is made available for downloading I will start to post more articles about AutoCAD for Mac programming.

Stay tuned!

Tuesday, October 12, 2010

XCode 3 versus 4

Hello,

One of disadvantages from those who are migrating from Windows environment to Mac OSX is the new compiler tool. XCode is really good but Visual Studio has been the best IDE for a long time.
XCode 3.2 IDE
Apple just released a Preview version of XCode 4 which presents several new tools and benefits but one of them captured my attention: "XCode Workspace". Yes, the current version does not provide an integrated environment equivalent to Visual Studio Solution.


For those who create simple applications with one or two modules it is not a big deal but for those who have to deal with 5 or 10 projects at once with dependencies among them it would be a pain!


Actually XCode 3 provides a special window called "Organizer" which allow you to kind of have all projects placed together but with a not well clear working behavior.
XCode 3.2 Organizer


I think XCode 4 with this specific Workspace feature plus all the other major improvements will really make the difference for those coming from Visual Studio and will make their lives much easier.


Autodesk didn't confirm yet if ObjectARX for Mac will be compatible with XCode 4 neither if it will be capable of generating compatible binaries.


More information about XCode 4 Preview can be found here: 


XCode 4 Preview


On the next post I will talk more about Targets and how they can make your life easier.


Stay tuned.