Question: I am currently using the AppDelegate in my first iPhone app to handle application level events.

In my app I have an enabled and disabled state, so when the user selects disabled some of the buttons on the application should be set to disabled.

My AppDelegate gets notified of the state. But what is the best approach to let my UIViews know that they should disable some of their buttons?

What is the standard approach to communicate events from the AppDelegate to the UI screens?

**EDIT**:

My description is slightly wrong, the user can disable the buttons in my app but conditions such as lack of Wi-Fi can as well, so I need to be dynamically able to change the UI state also.

Answer: 
This is an area where Delphi turns something that is a simple one-line assignment statement in most languages into something more complicated.

One approach would to declare the value as a typed constant:

```
type
  HSVRealArray = array[1..3] of real;
const
  constHSVVal: HSVRealArray = (0, 0, 0);
var
  currentValue: HSVRealArray;
begin
  currentValue := constHSVVal;
end;

```

Another approach is to create utility functions that return the type you need:

```
function MakeHSVRealArray(H, S, V: Real): HSVRealArray;
begin
  Result[1] := H;
  Result[2] := S;
  Result[3] := V;
end;

currentValue := MakeHSVRealArray(0,0,0);

```
Putting aside the general question, I'd like to point out that the specific use-case was never going to work anyway: Delphi can't return on the stack the contents of an array of unknown length. 

The return type of a function needs to be known by the calling code. It may be a pointer to the heap: it may even be a memory-managed object on the stack: but it is not permitted to be an undefined number of bytes on the stack, decided dynamically by the target function.

And in many other languages, the example

```
return (0,0,0)  //return pointer to automatic allocation

```

would be undefined, even if the compiler lets you do it. 

A common method of defining, using and returning const values is

```
int myarray[8] = {128, 38459, 438 ... 23674};
memcpy (myparam, myArray, sizeof (myArray)); 

```

... and you can do that in Delphi