1

我得到no visible @ interface for "ICMinorWorksPart1" declares the selector "dismissModalViewControllerAnimated"以下内容:

[self presentModalViewController:picker animated:YES];
[self dismissModalViewControllerAnimated:YES];
[self dismissModalViewControllerAnimated:YES];

我只是无法弄清楚编译器在抱怨什么?

。H

#import <AddressBookUI/AddressBookUI.h>

@interface ICMinorWorksPart1 : ICCertificateComponent   <UITextViewDelegate,ABPeoplePickerNavigationControllerDelegate>

.....

.m

 #import "ICMinorWorksPart1.h"




@implementation ICMinorWorksPart1
@synthesize dateMinorWorksCompletedField=_dateMinorWorksCompletedField;
@synthesize certificateReferenceField=_certificateReferenceField;
@synthesize clientField=_clientField;
@synthesize detailsOfDeparturesField=_detailsOfDeparturesField;
@synthesize descriptionOfMinorWorksField=_descriptionOfMinorWorksField;
@synthesize addressOfTheMinorWorks=_addressOfTheMinorWorks;

 - (id)initWithCertificate:(Certificate *)certificate
 {




if ((self = [super initWithCertificate:certificate])) {
    [[NSBundle mainBundle] loadNibNamed:@"MinorWorksPart1" owner:self options:nil];
    self.view.contentSize = CGSizeMake(self.contentView.frame.size.width, self.contentView.frame.size.height);

    self.dateMinorWorksCompletedField.textValue = ([self attributeWithName:@"dateMinorWorksCompleted"]).value;

    DebugLog(@"dateMinorWorksCompleted attribute value is %@", ([self attributeWithName:@"dateMinorWorksCompleted"]).value);
    DebugLog(@"Certificate reference is %@", self.certificate.reference);
    self.certificateReferenceField.text = (self.certificate.reference != nil ? self.certificate.reference : @"");
    self.clientField.text = ([self attributeWithName:@"client"]).value;
    self.detailsOfDeparturesField.text = ([self attributeWithName:@"detailsOfDepartures"]).value;
    self.addressOfTheMinorWorks.text = ([self attributeWithName:@"addressOfTheMinorWorks"]).value;
    self.descriptionOfMinorWorksField.text = ([self attributeWithName:@"descriptionOfMinorWorks"]).value;
 }
return self;





 }

- (void)save
 {
([self attributeWithName:@"dateMinorWorksCompleted"]).value = [ICUtils nonNilString:self.dateMinorWorksCompletedField.textField.text];
DebugLog(@"dateMinorWorksCompleted value is %@", self.dateMinorWorksCompletedField.textField.text);
self.certificate.reference = [ICUtils nonNilString:self.certificateReferenceField.text];
([self attributeWithName:@"client"]).value = [ICUtils nonNilString:self.clientField.text];
([self attributeWithName:@"detailsOfDepartures"]).value = [ICUtils nonNilString:self.detailsOfDeparturesField.text];
([self attributeWithName:@"addressOfTheMinorWorks"]).value = [ICUtils nonNilString:self.addressOfTheMinorWorks.text];
([self attributeWithName:@"descriptionOfMinorWorks"]).value = [ICUtils nonNilString:self.descriptionOfMinorWorksField.text];
 }





//add adress
- (IBAction)addAddressBtn:(id)sender {


ABPeoplePickerNavigationController *picker =

[[ABPeoplePickerNavigationController alloc] init];

picker.peoplePickerDelegate = self;

[self presentModalViewController:picker animated:YES];


}

- (void)peoplePickerNavigationControllerDidCancel:


(ABPeoplePickerNavigationController *)peoplePicker
{
[self dismissModalViewControllerAnimated:YES];
 }


 - (BOOL)peoplePickerNavigationController:
(ABPeoplePickerNavigationController *)peoplePicker
  shouldContinueAfterSelectingPerson:(ABRecordRef)person {

[self displayPerson:person];
[self dismissModalViewControllerAnimated:YES];

return NO;
}

 - (BOOL)peoplePickerNavigationController:
 (ABPeoplePickerNavigationController *)peoplePicker
  shouldContinueAfterSelectingPerson:(ABRecordRef)person
                            property:(ABPropertyID)property
                          identifier:(ABMultiValueIdentifier)identifier
{
return NO;
}
4

1 回答 1

2

如果ICMinorWorksPart1类的超类 ( ICCertificateComponent) 不是其子类,UIViewController则错误为真,该类dismissModalViewControllerAnimated:的方法也是如此UIViewController

此外,类的presentModalViewController:animated:dismissModalViewControllerAnimated:方法UIViewController在 iOS 6 中都已弃用,因此您可能也需要注意这一点。

于 2012-10-23T22:04:03.110 回答