2012-10-29 3 views
2

내 앱에서 사용자는 일부 주소 정보를 입력해야합니다. 버전 1.0부터 주소록 버튼을 제공합니다. 이전 테스트에서 제대로 작동했지만 UITextField.Text 속성을 설정하려고하면 SIGSEGV가 표시됩니다. 이 오류는 MonoTouches Debug 모드에서 PeoplePicker에서 주소를 선택하려고 할 때마다 발생합니다. 내 iPhone에서 TextFields를 설정하고 다음 ViewController를 푸는 사이에 eror가 임의로 발생합니다. 내 코드에 문제가 있습니까? 아니면 버그입니까? 내 TextField의 텍스트를 ABPeoplePickerModule에서 설정하는 동안 SIGSEGV가 있습니다.

 //AB Button Event 
     addressBook.TouchUpInside += delegate { 
      //Create new Picker 
      ABPeoplePickerNavigationController PP = new ABPeoplePickerNavigationController(); 
      //Cancel Event 
      PP.Cancelled += delegate { 
       NavigationController.DismissViewController(true, null); 
      }; 
      //Select Event 
      PP.SelectPerson += delegate(object sender, ABPeoplePickerSelectPersonEventArgs e) { 
       //Detailed Person View 
       ABPersonViewController pv = new ABPersonViewController(); 
       //Action when clicked on a Property 
       pv.PerformDefaultAction += delegate(object person, ABPersonViewPerformDefaultActionEventArgs ev) { 
        //If the Property was an Address 
        if(ev.Property.ToString() == "Address"){ 
         string lands = "", orts = "", plzs = ""; 
         try{ 
          //Read the Detailed Address Data from the clicked property 
          ABMultiValue<PersonAddress> addresses = ev.Person.GetAllAddresses(); 
          PersonAddress[] values = addresses.GetValues(); 
          lands = values[ev.Identifier.Value].Country.ToString(); 
          orts = values[ev.Identifier.Value].City.ToString(); 
          plzs = values[ev.Identifier.Value].Zip.ToString(); 
         }catch{ 
          Console.WriteLine("Fehlerhafte Addresse"); 
         } 
         //Set the Textfield with the new information 
         //iPhone Simulator in Debugmode crashes here everytime 
         land.Text = lands; 
         ort.Text = orts; 
         plz.Text = plzs; 
         //Close the Module 
         NavigationController.DismissViewController(true, null); 
        } 
       }; 
       //Set selected Person for the person View 
       pv.DisplayedPerson = e.Person; 
       //Open Person View with navigation from the PeoplePicker Controller 
       PP.PushViewController(pv, true); 
      }; 
      //Open PeoplePicker Controller Module 
      NavigationController.PresentViewController(PP, true, null); 
     }; 

미리 감사드립니다.

+0

사용중인 MonoTouch의 버전을 알 수 있습니까? 몇 시간 전에 6.0.5가 베타 버전으로 출시되었으며 비슷한 문제에 대한 해결책이 있습니다. 그것을 시도해 볼 수 있습니까? – poupou

+0

좋아요 :-)이 질문을 답으로 추가하여 다른 사람들이 같은 문제를 찾는 데 유용 할 수 있습니다. 이 질문에 답을 표시해 주시면 도움이됩니다. 확인해 주셔서 감사합니다. – poupou

답변

2

방금 ​​출시 된 MonoTouch 6.0.5에는 issue 수정 사항이 있습니다.

+0

고마워, 그게 내 문제를 해결! –