Re: [F-Script-talk] not automatically introspecting, wtf?
Brought to you by:
pmougin
From: Philippe M. <pm...@ac...> - 2004-07-31 21:07:50
|
The article you cited is a bit unclear on this point. The object browser does not automatically find all the object instances in the current application. It only displays either: - The object you provide to it if you open it using the browse: method defined on class System. Example: sys browse:'hello' - The objects that are defined in your F-Script workspace. Those are the objects that you (or some routine) have assigned to an F-Script variable (ex: the instruction "A := 6" assigns an NSNumber with a value of 6 to the variable A). Note that "sys" is a special variable that is automatically defined in your F-Script workspace. - The object that you select with the "Select view" button. - All the classes linked in the current application, when you use the "Classes" button From these objects, and by invoking the appropriate methods, you can often navigate to the objects that are of interest to you. Example: Clicking on the "Classes" button gives the list off all the classes in the application. Selecting the "NSUserDefault" class gives the list of class method for this class. Clicking on the "standardUserDefault" method invokes it and gives an NSUserDefault instance. Selecting it gives the list of its methods. Clicking on the "dictionaryRepresentation" method invokes it and returns a dictionary containing the current user default settings, etc... > and even with "select view" i cannot simply edit the text of a > value and manipulate the app in real-time. The browser lets you manipulate the app in real time by invoking methods on objects (by definition, objects are supposed to be manipulated like that: think encapsulation, abstract data type, etc...) Example: using the "select view" feature, select a button. The browser should display it (as well as some of its attributes). Select it in the object browser (click on the first row). The object browser should now display its methods. Now click on the "setTitle:" method, provide a string in the sheet that asks you for arguments (for instance type: 'hello' (with the simple cotes)), press return and look at your button on screen. Its title should now reads "hello". Best, Phil |