title: 'NSInvalidArgumentException', reason: '*** setObjectForKey: object cannot be nil (key: device_uid)'
body: <p>I have an error when trying to run the application on my iPhone. I don't understand why I have a nil error in this case</p>
  <pre><code>Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '  setObjectForKey: object cannot be nil (key: device_id)'
  First throw call stack: (0x183ce0f48 0x19918bf80 0x183bcc4e0 0x10006f5f0 0x1002b9ca8 0x1002b9c68 0x1002bf710 0x183c981f8 0x183c96060 0x183bc4ca0 0x18f148088 0x1892dcffc 0x1000716a0 0x1999ce8b8)
  libc++abi.dylib: terminating with uncaught exception of type NSException
  </code></pre>
  <p>Here is the part of    appdelegate.m file concerned by this error :</p>
  <pre class="lang-objectivec prettyprint-override"><code>// Get the users Device Model, Display Name, Token &amp; Version Number
  UIDevice *device = [UIDevice currentDevice];
  
  NSUserDefaults *dict = [NSUserDefaults standardUserDefaults];
  NSString *identifier = [dict stringForKey:@&quot;identifier&quot;];
  NSString *deviceName = device.name;
  NSString *deviceModel = device.model;
  NSString *deviceSystemVersion = device.systemVersion;
  
  // Prepare the Device Token for Registration (remove spaces and &lt; &gt;)
  NSString *deviceToken = [[[[token description]
  stringByReplacingOccurrencesOfString:@&quot;&lt;&quot;withString:@&quot;&quot;]
  stringByReplacingOccurrencesOfString:@&quot;&gt;&quot; withString:@&quot;&quot;]
  stringByReplacingOccurrencesOfString: @&quot; &quot; withString: @&quot;&quot;];
  
  NSMutableDictionary *postDatas = [NSMutableDictionary dictionary];
  [postDatas setObject:appName forKey:@&quot;app_name&quot;];
  [postDatas setObject:appVersion forKey:@&quot;app_version&quot;];
  [postDatas setObject:identifier forKey:@&quot;device_uid&quot;];
  [postDatas setObject:deviceToken forKey:@&quot;device_token&quot;];
  [postDatas setObject:deviceName forKey:@&quot;device_name&quot;];
  [postDatas setObject:deviceModel forKey:@&quot;device_model&quot;];
  [postDatas setObject:deviceSystemVersion forKey:@&quot;device_version&quot;];
  [postDatas setObject:pushBadge forKey:@&quot;push_badge&quot;];
  [postDatas setObject:pushAlert forKey:@&quot;push_alert&quot;];
  [postDatas setObject:pushSound forKey:@&quot;push_sound&quot;];
  
  Request *request = [Request alloc];
  request.delegate = self;
  
  [request postDatas:postDatas withUrl:@&quot;push/iphone/registerdevice/&quot;];
  </code></pre>
  <p>is this method deprecated?</p>