title: NSUserDefaults not working on Xcode beta with Watch OS2
body: <p>I just installed the latest beta of Xcode to try <strong>Swift 2</strong> and the improvements made to the Apple Watch development section.</p>
  
  <p>I'm actually having an hard time figuring out WHY this basic <code>NSUserDefaults</code> method to share informations between <strong>iOS</strong> and <strong>Watch OS2</strong> isn't working.</p>
  
  <p>I followed <a href="http://iosmobappdev.blogspot.it/2014/12/watchkit-sharing-data-using.html" rel="nofollow noreferrer">this <em>step-by-step</em> tutorial</a> to check if I missed something in the process, like turning on the same group for both the phone application and the extension, but here's what I got: <strong>NOTHING</strong>.</p>
  
  <p>Here's what I wrote for the ViewController in the iPhone app:</p>
  
  <pre><code>import UIKit
  
  class ViewController: UIViewController {
      @IBOutlet weak var lb_testo: UITextField!
      let shared_defaults:NSUserDefaults = NSUserDefaults(suiteName: "group.saracanducci.test")!
      var name_data:NSString? = ""
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
          name_data = shared_defaults.stringForKey("shared")
          lb_testo.text = name_data as? String
      }
  
      override func didReceiveMemoryWarning() {
          super.didReceiveMemoryWarning()
      }
  
      @IBAction func upgrade_name(sender: AnyObject) {
          name_data = lb_testo.text
          shared_defaults.setObject(name_data, forKey: "shared")
  
          lb_testo.resignFirstResponder()
          shared_defaults.synchronize()
      }
  }
  </code></pre>
  
  <p>And here's what I have in the InterfaceController for WatchKit:</p>
  
  <pre><code>import WatchKit
  import Foundation
  
  class InterfaceController: WKInterfaceController {
      @IBOutlet var lb_nome: WKInterfaceLabel!
      let shared_defaults:NSUserDefaults = NSUserDefaults(suiteName: "group.saracanducci.test")!
      var name_data:NSString? = ""
  
      override func awakeWithContext(context: AnyObject?) {
          super.awakeWithContext(context)
      }
  
      override func willActivate() {
          super.willActivate()
  
          if (shared_defaults.stringForKey("shared") != ""){
              name_data = shared_defaults.stringForKey("shared")
              lb_nome.setText(name_data as? String)
          }else{
              lb_nome.setText("No Value")
          }
      }
  
      override func didDeactivate() {
          super.didDeactivate()
      }
  }
  </code></pre>
  
  <p>I made some tests and it seems like the iOS app and the Watch OS one take advantage of different groups...<strong>they're not sharing information</strong>, they store them locally.</p>
  
  <p>Is someone having the same issue? Any idea how to fix it?</p>