O'Reilly logo

REALBasic: TDG, 2nd Edition by Matt Neuburg

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Referring to Instances

Once your application is running and some instances have been generated, much of the action will be precipitated by your code calling methods, and getting and setting properties—in other words, by sending messages to instances.

Many of REALbasic’s built-in methods, as was pointed out earlier, are global, but many of them belong to some particular class, and the only way you can call these is by sending a message to an instance of that class. The same is true for methods that you write: you can write global methods (as will be explained in Chapter 4), but for the most part, in line with the considerations presented in Section 3.2 earlier in this chapter, you’ll write them as method handlers in some class, and the only way you can call such a method is by sending a message to an instance of that class.

Exactly the same thing is true for properties. Many of REALbasic’s built-in classes have properties, and you will often need to retrieve the value of such properties, as a way of obtaining information; for example, getting a window’s Top and Left properties tells you where it is on the screen. You’ll also frequently want to change the value of such properties; for example, setting a window’s Top and Left properties is how you move the window. And of course you’ll frequently have properties you’ve created yourself, and though you can make global properties, more often you’ll declare the property in some particular class, and then you’ll want to get or set the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required