Question: I need to convert an Array List to Object[][], I have tried several different methods, and all seem to toss up an error or two.

My latest try is this:

```
Object[][] array = dataList.toArray(new Object[dataList.size()][]);

```

This throws the following error:

```none
java.lang.ArrayStoreException
    at java.lang.System.arraycopy(Native Method)
    at java.util.ArrayList.toArray(Unknown Source)

```

My array list is populated with classes I made, this is the class:

```
class dataClass {
    int x;
    int y;
    int z;
    String string1;
    String string2;
    Date date;
    int event;

    public dataClass(int x, int y, int z, String string1, String string2,
            Date date, int event) {
        this.x = x;
        this.y = y;
        this.z = z;
        this.string1 = string1;
        this.string2 = string2;
        this.date = date;
        this.event = event;
    }
}

```

This is how I initialize my array list:

```
public static List<dataClass> dataList = new ArrayList<dataClass>();

```

I then add my new dataClass via:

```
.add(new dataClass(...));

```

Any help would be great, thanks.

Answer: 
It's very simple, as it says @Stanislav Pankevich, but in 

swift 3 version

```
override func viewWillLayoutSubviews() {
    super.viewWillLayoutSubviews();
    UIApplication.shared.isStatusBarHidden = false
}

```
I was having the same issue and using @entropid solution I was able to fix the navigation bar problem. But my view remains below the nav bar which I fix using "sizeToFit". 

```
[[NSNotificationCenter defaultCenter] addObserverForName:@"UIWindowDidRotateNotification" object:nil queue:nil usingBlock:^(NSNotification *note) {
    if ([note.userInfo[@"UIWindowOldOrientationUserInfoKey"] intValue] >= 3) {
        [self.navigationController.navigationBar sizeToFit];
        self.navigationController.navigationBar.frame = (CGRect){0, 0, self.view.frame.size.width, 64};
    }
}];

```

I haven't tested it properly but its working for me right now