cocoa

  • Change Company Name in XCode __MyCompanyName__ Objective-C Cocoa

    See references below for original article. There are a couple ways to change the __MyCompanyName__ value. Permanently (open terminal and enter): Alternatively, changing the “Me” card in Address book or going to Project->Edit Project Settings->General Tab in XCode 3.2.3 also… Continue reading

  • Get Current Directory in Objective-C

    Since Mac OS X is a unix based system, you can always use “getcwd” from the standard C library, but in general if you want to stick within the context of Objective-C/Cocoa, see the examples below. Here’s one snippet you… Continue reading

  • Concatenate string in Objective-C

    Unfortunately, this is not as straight forward as it seems it should be. This really comes down to roughly two approaches in my opinion: stringByAppendingString approach: strigWithFormat approach: References StackOverflow, http://stackoverflow.com/questions/510269/how-do-i-concatenate-strings-in-objective-c cocoadevcentral.com, “Learn Objective-C”, http://cocoadevcentral.com/d/learn_objectivec/ Continue reading

  • Show Dialog Message Box in Objective-C Cocoa

    There are a few ways to achieve this in Objective-C/Cocoa, and I found NSAlert to be the simplest base class for this purpose. See example below of a small Utility class with this functionality. Util.h Util.m References iphonedevsdk.com, http://www.iphonedevsdk.com/forum/iphone-sdk-development/8478-simple-message-box-popup.html blogspot.com,… Continue reading

  • View PDF in Objective-C Cocoa on Mac OS X using PDFKit

    The code below has been tested and works clean on the latest version of Mac OS X 10.5 Leopard. Since it applies to native Mac OS X, and not iOS, porting this to work on iPhone/iPad is a bit different,… Continue reading