Question: When I try to store arrays from Parse into a local array I can only access it within the `findObjectsInBackgroundWithBlock {...}`. When I print it outside of that block, it shows `[]`...

Code :

```
var qArray : [[Int]] = []

override func viewDidLoad() {
    super.viewDidLoad()

    let query = PFQuery(className: "Trivia")
    query.findObjectsInBackgroundWithBlock {
        (objects: [PFObject]?, error: NSError?) in
        if objects != nil {
            if let objects = objects {
                for object in objects {
                    self.qArray.append(object["mainPattern"] as! [Int])
                }
                print(self.qArray) // Prints a multi dimension array
            }
        }
        if error != nil {
            print(error)
        }
    }
    print(self.qArray) // prints []
}

```

Answer: 
For anyone interested in the future, I solved this problem, as I'm using angular 2 in my app, I defined as you can see in my code snippet a base url for my app :

```
  <base href="/">

```

This becomes a problem in cordova and should be deleted for an android/ios app.
if css and js folder are in same level as index.html you should link them like this :-

```
<link href="css/android/prelogin.css" rel="stylesheet">
<script type="text/javascript" src="cordova.js"></script>
<script src="scripts/lib/jquery/jquery.1.9.1.js"></script>
<script src="scripts/lib/jquery/jquery.mobile-1.3.2.js"></script>

```

see screen shot for more clarity

[![enter image description here](https://i.stack.imgur.com/t4cHp.png)](https://i.stack.imgur.com/t4cHp.png)