title: uniqueIdentifier deprecated, example from Cocos2d
body: <p>I have searched the web for the answer and have found quite a few solutions but have to admit i do not really understand, as i am pretty new, how to apply the answer, one example is: <a href="https://stackoverflow.com/questions/6993325/uidevice-uniqueidentifier-deprecated-what-to-do-now">UIDevice uniqueIdentifier Deprecated - What To Do Now?</a> </p>
  
  <p>I would really appreciate if someone could show me an example how to apply the solution to the problem in the code below as the following line is deprecated (uniqueIdentifier), the code line is from Cocos2d CLScoreServerRequest.m but comes up in a few others as well:</p>
  
  <pre><code>device = [[UIDevice currentDevice] uniqueIdentifier];
  </code></pre>
  
  <p>The function looks like:</p>
  
  <pre><code>-(BOOL) requestScores:(tQueryType)type
              limit:(int)limit
             offset:(int)offset
              flags:(tQueryFlags)flags
           category:(NSString*)category
  {
  // create the request   
  [receivedData setLength:0];
  
  // it's not a call for rank
  reqRankOnly = NO;
  
  NSString *device = @"";
  if( flags &amp; kQueryFlagByDevice )
      device = [[UIDevice currentDevice] uniqueIdentifier];
  
  // arguments:
  //  query: type of query
  //  limit: how many scores are being requested. Default is 25. Maximun is 100
  //  offset: offset of the scores
  //  flags: bring only country scores, world scores, etc.
  //  category: string user defined string used to filter
  NSString *url= [NSString stringWithFormat:@"%@?gamename=%@&amp;querytype=%d&amp;offset=%d&amp;limit=%d&amp;flags=%d&amp;category=%@&amp;device=%@",
                  SCORE_SERVER_REQUEST_URL,
                  gameName,
                  type,
                  offset,
                  limit,
                  flags,
                  [category stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding],
                  device
                  ];
  
  //  NSLog(@"%@", url);
  
  NSURLRequest *request=[NSURLRequest requestWithURL:[NSURL URLWithString:url]
                                         cachePolicy:NSURLRequestUseProtocolCachePolicy
                                     timeoutInterval:10.0];
  
  // create the connection with the request
  // and start loading the data
  self.connection=[NSURLConnection connectionWithRequest:request delegate:self];
  if (! connection_)
      return NO;
  
  return YES;
  }
  </code></pre>