使用dd-plist的Android plist解析器

【使用dd-plist的Android plist解析器】少年意气强不羁,虎胁插翼白日飞。这篇文章主要讲述使用dd-plist的Android plist解析器相关的知识,希望能为你提供帮助。

  1. {
  2. NSDictionary rootDict = getNSDFromPath( context, mapPinPath) ;
  3.  
  4. int len = rootDict.count( ) , i;
  5. for( i=1; i< =len; i++)
  6. {
  7. NSDictionary NSItem = ( NSDictionary) rootDict.objectForKey( " Item" +i) ;
  8.  
  9. NSDictionary NSMap = ( NSDictionary) NSItem.objectForKey( " Real" ) ;
  10. NSObject NSMapX = NSMap.objectForKey( " x" ) ;
  11. NSObject NSMapY = NSMap.objectForKey( " y" ) ;
  12.  
  13. NSDictionary NSReal = ( NSDictionary) NSItem.objectForKey( " Map" ) ;
  14. NSObject NSRealX = NSReal.objectForKey( " x" ) ;
  15. NSObject NSRealY = NSReal.objectForKey( " y" ) ;
  16.  
  17.  
  18.  
  19. //Log.d(" NSObject" ," NSO: " + NSItem);
  20. }
  21.  
  22.  
  23. }
  24. private NSDictionary getNSDFromPath( Context context, String path) {
  25.  
  26. try {
  27. return ( NSDictionary) PropertyListParser.parse( context.getAssets( ) .open( path) ) ;
  28. } catch ( Exception e) {
  29. // TODO Auto-generated catch block
  30. e.printStackTrace( ) ;
  31. }
  32. return null;
  33.  
  34. }


    推荐阅读