Advertisement
Guest User

Untitled

a guest
Nov 25th, 2014
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1. I am getting an issue in assigning the MKMapView object to view,
  2.  
  3. UIView *tempView = [[UIView alloc]initWithFrame:CGRectMake(1, 102, 318, 377)];
  4. [self.view addSubview:tempView];
  5. lMapViewTemp = [[MKMapView alloc]initWithFrame:CGRectMake(0, 0, 318, 377)];
  6. lMapViewTemp.delegate = self;
  7.  
  8. Issue at this line:
  9.  
  10. [tempView addSubview:lMapViewTemp]; EXC_BAD_ACCESS (Code=1,address=0xc)
  11.  
  12. When i call the above structure once, Its working fine. And after,
  13. //calling for add contact
  14. - (IBAction)BnEditContact:(id)sender{
  15. UIButton *button = sender;
  16. buttonTag = (int)button.tag;
  17. if(!picker){
  18. picker=[[ABPeoplePickerNavigationController alloc] init];
  19. }
  20. picker.peoplePickerDelegate = self;
  21. [self presentViewController:picker animated:YES completion:nil];
  22. }
  23.  
  24. -(BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker
  25. shouldContinueAfterSelectingPerson:(ABRecordRef)person property:(ABPropertyID)property
  26. identifier:(ABMultiValueIdentifier)identifier{
  27. [self dismissViewControllerAnimated:YES completion:nil];
  28. return NO;
  29. }
  30.  
  31. - (void)peoplePickerNavigationControllerDidCancel:(ABPeoplePickerNavigationController *)peoplePicker
  32. {
  33. [self dismissViewControllerAnimated:YES completion:nil];
  34. }
  35.  
  36. - (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person {
  37. //calls displayPerson:(ABRecordRef)person to show contact's information in the app
  38. [self displayPerson:person];
  39. [self dismissViewControllerAnimated:NO completion:NULL];
  40. return NO;
  41. }
  42.  
  43. I am receiving contacts from the above code. Now, If i again try to access the mapView. Its raising Issue.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement