English 中文(简体)
利用AB NewPersonViewController
原标题:Dismissing UIPopoverController when using ABNewPersonViewController

我有一个“附加接触”纽芬兰语,当我上台时,我就有一名导航控制员,以全心全意的方式控制新PersonController公司。

如果在iPad,我就跑了一场大鼠,我可以与新手控制器一道在冰箱内展示。

问题在于试图开除。

在我执行“Complete”案时,我可以否认有人的愤怒。 利用新人;

if(self.popoverController != nil)
    [popoverController dismissPopoverAnimated:YES];  

然而,在触及人口之外时,这并没有被忽略。

我已把YES归还给我的驻地审计员。 1. 索马里 Popover methods and set the delegation of my popover to this. 我在这种方法中放下了一架NSLOG,在这种方法中并未放下——我没有一件事?

是否有任何人知道在外面接触时如何开除人口?

www.un.org/Depts/DGACM/index_spanish.htm 更新——更多的法典

-(IBAction)contactsClicked:(id) sender{

    ABNewPersonViewController *newPersonView = [[ABNewPersonViewController alloc] init];
    [newPersonView setNewPersonViewDelegate:self];
    [newPersonView setDisplayedPerson:newPerson];

        UINavigationController *addContactNavController = [[UINavigationController alloc] initWithRootViewController:newPersonView];
        [newPersonView release];


        if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {

            if(self.popoverController == nil){
                UIPopoverController *popover = [[UIPopoverController alloc] initWithContentViewController:addContactNavController];

                self.popoverController = popover;
                self.popoverController.delegate = self;
                [popover release];
            }
            CGRect frame = [sender frame];
            [popoverController presentPopoverFromRect:frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionRight animated:YES];
        } else {
            [self presentModalViewController:addContactNavController animated:YES];
            [addContactNavController release];
        }
    }
-(void)unknownPersonViewController:(ABUnknownPersonViewController *)unknownPersonView didResolveToPerson:(ABRecordRef)person{
    [self dismissModalViewControllerAnimated:YES];
}
-(void)newPersonViewController:(ABNewPersonViewController *)newPersonViewController didCompleteWithNewPerson:(ABRecordRef)person {
    NSLog(@"DONE OR CANCEL clicked!!!!"); //prints
    if (self.popoverController != nil) {
        [popoverController dismissPopoverAnimated:YES];
    }
    [self dismissModalViewControllerAnimated:YES];
}

新的个人控制员的Done和Cancel纽芬兰人工作,开除控制员和人口(在iPad上课)。 我猜测这是指为AB NewPersonViewController而指派的代表得到正确执行。 ?

我猜想,我可能会通过多位控制者混淆这一问题,而我的流行代表方法正在变得隐蔽或一些东西?

预 收

<EDIT - 代表方法

-(BOOL)popoverControllerShouldDismissPopover:(UIPopoverController *)thePopoverController{
    NSLog(@"clicked outside the popover");//never prints
    return YES;
    }
问题回答

参考:

登革窗内的塔皮不会自动导致登革。 你的看法和看法控制器法必须明确处理人口内部的行动和活动,并称之为“脱贫:需要的方法”。

您应使用人口代表方法-popoverControllerShouldDismissPopover:在即将被解雇时听取意见,并尽力节省费用等。 在那里。

另外,请使用<条码>自封/条码>而不是<条码>。





相关问题
List Contents of Directory in a UITableView

I am trying to list the contents of Ringtones directory in a TableView, however, I am only getting the last file in the directory in ALL cells, instead of file per cell. This is my code: - (...

iPhone NSUserDefaults persistance difficulty

In my app i have a bunch of data i store in the NSUserdefaults. This information consists of an NSObject (Object1) with NSStrings and NSNumbers and also 2 instances of yet another object (Object2). ...

Writing a masked image to disk as a PNG file

Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...

Resize UIImage with aspect ratio?

I m using this code to resize an image on the iPhone: CGRect screenRect = CGRectMake(0, 0, 320.0, 480.0); UIGraphicsBeginImageContext(screenRect.size); [value drawInRect:screenRect blendMode:...

Allowing interaction with a UIView under another UIView

Is there a simple way of allowing interaction with a button in a UIView that lies under another UIView - where there are no actual objects from the top UIView on top of the button? For instance, ...

热门标签