2011-08-17 5 views
0

다음과 같은 논리 경로가있는 속성 목록을 만들었습니다.속성 목록에서 상세 뷰를 그리는 방법은 무엇입니까?

 <array> 
    <dict> 
     <key>Title</key> 
     <string>Construction</string> 
     <key>Children</key> 
     <array> 
      <dict> 
       <key>Title</key> 
       <string>Advisory Services</string> 
      </dict> 
      <dict> 
       <key>Title</key> 
       <string>Disputes Services</string> 
       <key>Details</key> 
       <dict> 
        <key>Title</key> 
        <string>Disputes Services</string> 
        <key>Associated Image</key> 
        <string>Construction_iPhone.png</string> 
        <key>Industry Info</key> 
        <string>Planning and executing a construction project is a complex process that can be thrown off course by a variety of factors. Many root causes of delivery overrun are seeded during project development and procurement. Through our extensive construction dispute experience, we have discerned patterns of cost and schedule overruns and project failures that repeat themselves among projects. We leverage this insight to help owners, contractors, providers of capital and counsel identify and proactively manage potential problems throughout the lifecycle of large construction projects. We also help to manage the risks associated with any claims arising in those projects, particularly those in the infrastructure, healthcare and energy industries.</string> 
       </dict> 
      </dict> 
     </array> 

본질적으로 문자열 목록을 가져 오는 드릴 다운 응용 프로그램을 만들었습니다. 이제 자세히 뷰 컨트롤러를 설정하고 싶기 때문에 몇 가지 변수를 만들어서 시작하겠습니다.

//DetailViewController.h 

IBOutlet NSString *title; 
IBOutlet UIImage *associatedImage; 
IBOutlet NSString *IndustryInfo; 

인터페이스 빌더에 이미지와 두 개의 텍스트 상자를 드래그했습니다. 그에 따라 연결. 그것은 단지 페이지 상단의 이미지이고 두 개의 텍스트 상자입니다. 너무 복잡한 것은 아닙니다.

물론이 정보를 얻으려면 속성 목록을 사용하도록 설정하고 싶습니다. 문제는 iOS 개발이 처음 인 점입니다. 내 구현에서 objectForKey를 사용하여 원하는 정보를 구문 분석하여 화면에 표시하는 방법을 어떻게 설정합니까? 또한, 어떻게 내가 UIImage를 설정한다는 사실을 고려해 보았습니다. 나는 그것을 .plist에 문자열로 설정 했습니까? 감사!

답변

0

plist에 따라 NSPropertyListSerialization 또는 [NSArray arrayWithContentsOfFile:...] 또는 [NSDictionary dictionaryWithContentsOfFile:...]으로 plist 파일을 읽을 수 있습니다. 어떻게 이미지를 설정했는지 모르겠지만 [UIImage imageNamed:...] 또는 [UIImage imageWithContentsOfFile:...]으로로드 할 수 있습니다.

관련 문제