links for 2009-06-27
2009-06-27 03:01 am-
An urban legend, unfortunately.
-
It's straightforward to write unit tests for Objective-C Cocoa frameworks with Xcode 2.1 and later.
First, turn off ZeroLink when building your framework. ZeroLink is a great technology, but you can't link against something that's built with ZeroLink, and that's exactly what your unit tests are going to do. Note: You only need to do this for Xcode 2.1 through Xcode 2.5. Xcode 3.0 removed support for ZeroLink, since the linker is now sufficiently fast as to obviate it.
-
So you've set up unit testing for your Objective-C Cocoa framework and it's been working great. But now you've written a test and it fails, and you can't figure out why. It's time to break out the debugger, but how, exactly, do you do that? Your unit tests are built as a bundle, and you can't run a bundle.
It's simple. All you have to do is set up an appropriate Executable in Xcode to run the test rig that runs your bundle, and then debug that. To get started, choose the Project > New Custom Executable menu item. For its name, specify otest â this is the name of the test rig used by OCUnit. Specify /Developer/Tools/otest as the path to your tool.
-
In the next two columns we will delve into the fundamentals of the classes NSString and NSMutableString; these two classes make up the majority of Cocoa's string-handling ability.
We'll start today by dealing with the various ways to create strings, and the basic manipulation methods that allow us to extract substrings, and search and compare strings too. However, before I get into that, I want to start with a mini-lesson about another concept of object-oriented programming: class clusters.
-
How classes actually get loaded into memory in Objective-C aren't anything that you, the programmer, need to worry about most of the time. It's a bunch of complicated stuff that's handled by the runtime linker and is long done before your code ever starts to run.
For most classes, that's all you need to worry about. But some classes need to do more, and actually run some code in order to perform some kind of setup. A class may need to initialize a global table, cache values from user defaults, or do any number of other tasks.
The Objective-C runtime uses two methods to provide this functionality: +initialize and +load.
-
Looking to learn how to develop applications for the iPhone? On this page youâll find examples, tips/tricks and best practices for developing iPhone applications. Click the Xcode icon to download the project source code.
-
Today, we will tie up some loose ends from the previous column. This will involve a discussion of several ways we can save the address book data between launches, and then go on to touch upon some memory management issues. In this process, we'll also learn about Mac OS X's preferences system.
-
This technote describes a number of 'secret' debugging facilities in Mac OS X, including environment variables, preferences, routines callable from GDB, special files, and so on. If you're developing for Mac OS X, you should look through this list to see if you're missing out on something that will make your life easier.
-
To effectively learn how to use GDB, you must understand frames, which are also called stack frames because they're the frames that comprise the stack. To learn about the stack, we need to learn about the memory layout of an executing program. The discussion will mainly be theoretical, but to keep things interesting we'll conclude the chapter with an example of the stack and stack frames using GDB.
-
It's called InstaCalc for a reason: answers appear as you type. Your time is important, the computer's time is not. Spend less time waiting, more time doing.
-
A debugger lets you pause a program, examine and change variables, and step through code. Spend a few hours to learn one so you can avoid dozens of hours of frustration in the future. This is a quick guide, more information here:
* Official Page - Documentation
* Sample session - Short Tutorial - Long Tutorial -
A debugger is a program that runs other programs, allowing the user to exercise control over these programs, and to examine variables when problems arise. The most popular debugger for UNIX systems is gdb, the GNU debugger. gdb has tons of features, however, you only need to use a few for it to be useful. There is complete documentation for gdb online, or you can read the man page (type "man gdb" at the unix command prompt), and the quick reference card is very handy.
-
A Sample GDB Session
You can use this manual at your leisure to read all about GDB. However, a handful of commands are enough to get started using the debugger. This chapter illustrates those commands.
-
GDB can print parts of your program's source, since the debugging information recorded in the program tells GDB what source files were used to build it. When your program stops, GDB spontaneously prints the line where it stopped. Likewise, when you select a stack frame (see section Selecting a frame), GDB prints the line where execution in that frame has stopped. You can print other portions of source files by explicit command.
-
This tutorial gives an overview on basic features of GDB. It is assumed that audience is familiar with GCC and "GNU Make". It is also assumed that user has some prior experience with some Debugging Environment.
-
When using Xcode on Mac OS X, the debugger underneath the covers is the GNU gdb
debugger. There are a number of extensions to gdb to support debugging Objective-C
applications. Here are a few tips that may be helpful. -
ZeroLink is a new feature to speed up turn around times for applications. This feature can be turned off if you are linking against a static library. It's easy to get confused as to weither or not ZeroLink is enabled when using a target inspector because the project settings will override target settings (for ZeroLink). You have to turn ZeroLink off in the project inspector (see BuildStyles) if a static library is not linking properly. Please note that ZeroLink is gone with XCode 3!
-
In use for over twenty years by performers, composers, artists, scientists, teachers, and students, Max is the way to make your computer do things that reflect your individual ideas and dreams. Version 5 is a dramatic transformation of Max that begins a new chapter in the program's history.
-
In this article, we explore the optimization levels provided by the GCC compiler toolchain, including the specific optimizations provided in each. We also identify optimizations that require explicit specifications, including some with architecture dependencies. This discussion focuses on the 3.2.2 version of gcc (released February 2003), but it also applies to the current release, 3.3.2.
Original: craschworks - comments