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: 
For array handling, array initialization and array constant declarations, Delphi doesn't make simple things simple.

In some situations similar to yours, I initialize the array with a utility function taking one open array parameter and returning the appropiate static string.

```
const
    MaxArray = 10;
type
    TRealStaticArray = array[0..MaxArray] of Real;

function RealArray(const AnArray: array of real):TRealStaticArray;
    const DefaultValue=0.0;
    var i: integer;
    begin
        // EDIT: commented out, thanks Serg. for i:= 0 to low(AnArray)-1 do result[i]:=DefaultValue;
        for i:= High(AnArray)+1 to MaxArray do
            result[i]:=DefaultValue;
        for i:= Low(AnArray) to High(AnArray) do
            if (i>=0) and (i<=MaxArray) then
                result[i]:=AnArray[i];
    end;

```

Use it this way:

```
 var MyArray: TRealStaticArray;
 ...
 MyArray := RealArray([10.0, 20.0, 30.0]);

```
I know this is an old post, but I came across this while looking into the auto-assignment technique for Delphi. This post has a very nice explanation, along with a way to auto-assign an array of records:

<http://delphi.about.com/od/adptips2006/qt/const_array.htm>

Unfortunately, the initialization can only be done with native or record types. Class objects need a helper function as others have shown above.