title: Swift objects using ? or?
body: <p>Okay, so I am copying a game that I have wrote in android studios over to swift for ios. I have figured out a lot of the syntax difference, but there is still some stuff that I cannot figure out. 
  I will post the swift code first, then I will post the java code to compare with, and finally I will explain what is supposed to be happening:</p>
  
  <pre><code>func set(t: Int){
      _type = 0;  //For debugging otherwise equal to t
      delay = 0;
      current = 0;
      last = 0;
      count = 0;
  
      switch (_type){
      case 0:
          pt = Array&lt;normal&gt;();
          let p1 = normal(bpc: self, gameScene: gm);
          let p2 = normal(bpc: self, gameScene: gm);
          let p3 = normal(bpc: self, gameScene: gm);
          length = 3;   //for array length
  
          pt?.append(p1);
          pt?.append(p2);
          pt?.append(p3);
  
          hit = Array&lt;Bool&gt;();
          hit?.append(false);
          hit?.append(false);
          hit?.append(false);
  
          break;
  </code></pre>
  
  <p>Now for the equivalent java code which works:</p>
  
  <pre><code>void set(int t){
      _type = t;
      delay = 0;
      current = 0;
      last = 0;
      count = 0;
  
      switch (_type){
          case 0:
              pt = new normal[3];
              hit = new boolean[3];
              for (int i = 0; i &lt; 3; i++){
                  pt[i] = new normal();
                  hit[i] = false;
              }
              break;
  </code></pre>
  
  <p>So The bottom code is the code in my android game that works. The code above is the code that I am trying to make work the same way, but I seem to be having problems with the array of object stuff. Also, I have the pt declared above as : </p>
  
  <pre><code>private var pt          : [Poop_Type]?;
  </code></pre>
  
  <p>and java equivalent is:</p>
  
  <pre><code>private Poop_Type pt[];
  </code></pre>