I am getting an issue in assigning the MKMapView object to view,
UIView *tempView = [[UIView alloc]initWithFrame:CGRectMake(1, 102, 318, 377)];
[self.view addSubview:tempView];
lMapViewTemp = [[MKMapView alloc]initWithFrame:CGRectMake(0, 0, 318, 377)];
lMapViewTemp.delegate = self;
Issue at this line:
[tempView addSubview:lMapViewTemp]; EXC_BAD_ACCESS (Code=1,address=0xc)
When I call the above structure once, Its working fine. And after,
//calling for add contact
- (IBAction)BnEditContact:(id)sender{
UIButton *button = sender;
buttonTag = (int)button.tag;
if(!picker){
picker=[[ABPeoplePickerNavigationController alloc] init];
}
picker.peoplePickerDelegate = self;
[self presentViewController:picker animated:YES completion:nil];
}
-(BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker
shouldContinueAfterSelectingPerson:(ABRecordRef)person property:(ABPropertyID)property
identifier:(ABMultiValueIdentifier)identifier{
[self dismissViewControllerAnimated:YES completion:nil];
return NO;
}
//delegate methods
- (void)peoplePickerNavigationController:(ABPeoplePickerNavigationController*)peoplePicker didSelectPerson:(ABRecordRef)person;
{
[self displayPerson:person];
}
- (void)peoplePickerNavigationControllerDidCancel:(ABPeoplePickerNavigationController *)peoplePicker
{
[self dismissViewControllerAnimated:YES completion:nil];
}
- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person {
//calls displayPerson:(ABRecordRef)person to show contact's information in the app
[self displayPerson:person];
[self dismissViewControllerAnimated:NO completion:NULL];
return NO;
}
I am receiving contacts from the above code. Now, If i again try to access the mapView. Its raising Issue.