Guest User

Untitled

a guest
Feb 20th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. @implementation CPDictionary (ReadFile)
  2.  
  3. +(id)dictionaryWithContentsOfURL:(CPURL)url
  4. {
  5.  
  6. var request = [CPURLRequest requestWithURL:url];
  7. var data = [CPURLConnection sendSynchronousRequest:request returningResponse:NULL error:NULL];
  8. if(data)
  9. {
  10. var dict = [CPPropertyListSerialization propertyListFromData:data format:CPPropertyListXMLFormat_v1_0 errorDescription:NULL];
  11. return dict;
  12. }
  13.  
  14. return nil;
  15. }
  16.  
  17. @end
Add Comment
Please, Sign In to add comment