简体   繁体   English

使用未声明的标识符PhonesViewController ios7 xCode

[英]Use of undeclared identifier PhonesViewController ios7 xCode

Can you please help me with this error that I'am getting... Basically, I'm trying to import all my contact list from my address book. 您能帮我解决我遇到的这个错误吗?基本上,我正在尝试从通讯录中导入我的所有联系人列表。 Also I'm checking the phone number label, but the error that I'm getting is "Use of undeclared identifier PhonesViewController ios7 xCode" and I have that viewController, and also I have added the class in storyboard for the viewcontroller although I think that it is not necessary Thanks in advance 另外,我正在检查电话号码标签,但出现的错误是“使用未声明的标识符PhonesViewController ios7 xCode”,并且具有该viewController,并且我在情节提要中为该类添加了该类,尽管我认为没必要先谢谢

Here is my code: 这是我的代码:

#import "PhonesViewController.h"

@implementation PhonesViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.

    - (BOOL)PhohesViewController: (ABPeoplePickerNavigationController *)picker shouldContinueAfterSelectingPerson:(ABRecordRef)person
    {
        // Name of contact.

        NSString* name = (NSString *)ABRecordCopyCompositeName(person);

        // Numbers of selected contact

        ABMutableMultiValueRef phones = ABRecordCopyValue(person, kABPersonPhoneProperty);

        NSMutableString *mobile = [[NSMutableString alloc] init];
        NSMutableString *office = [[NSMutableString alloc] init];

        // Getting if Mobile, Office(work) numbers exist

        for(CFIndex numberIndex = 0; numberIndex < ABMultiValueGetCount(phones); numberIndex++)
        {
            // Number in contact details of current index

            CFStringRef phoneNumberRef = ABMultiValueCopyValueAtIndex(phones, numberIndex);

            // Label of Phone Number

            CFStringRef locLabel = ABMultiValueCopyLabelAtIndex(phones, numberIndex);
            NSString *phoneLabel =(NSString*) ABAddressBookCopyLocalizedLabel(locLabel);

            // Phone number

            NSString *phoneNumber = (NSString *)phoneNumberRef;

            // Release Phone Number and locationLabel reference object

            CFRelease(phoneNumberRef);
            CFRelease(locLabel);

            NSLog(@"  - %@ (%@)", phoneNumber, phoneLabel);

            if ([phoneLabel isEqualToString:@"mobile"])// Mobile number saving.
            {
                [mobile appendFormat:@"%@", phoneNumber];
            }
            else if ([phoneLabel isEqualToString:@"work"])// Office number saving.
            {
                [office appendFormat:@"%@", phoneNumber];
            }

            [phoneNumber release];
        }
        CFRelease(phones);

        // Emails of selected contact

        ABMutableMultiValueRef emails = ABRecordCopyValue(person, kABPersonEmailProperty);

        NSMutableString *generalMail = [[NSMutableString alloc] init];
        NSMutableString *officeMail = [[NSMutableString alloc] init];

        // Getting if Home, Office(work) mails exist

        for(CFIndex numberIndex = 0; numberIndex < ABMultiValueGetCount(emails); numberIndex++)
        {
            // Mail in contact details of current index

            CFStringRef mailRef = ABMultiValueCopyValueAtIndex(emails, numberIndex);

            // Label of Phone Number

            CFStringRef locLabel = ABMultiValueCopyLabelAtIndex(emails, numberIndex);
            NSString *mailLabel =(NSString*) ABAddressBookCopyLocalizedLabel(locLabel);

            // Phone number

            NSString *mail = (NSString *)mailRef;

            // Release Phone Number and locationLabel reference object

            CFRelease(mailRef);
            CFRelease(locLabel);
            NSLog(@"  - %@ (%@)", mail, mailLabel);

            if ([mailLabel isEqualToString:@"mobile"])// Home mail.
            {
                [generalMail appendFormat:@"%@", mail];
            }
            else if ([mailLabel isEqualToString:@"work"])// Office(Work) mail.
            {
                [officeMail appendFormat:@"%@", mail];
            }

            [mail release];
        }
        CFRelease(emails);

        [mobile release];
        [office release];

        [generalMail release];
        [officeMail release];

        [self dismissViewControllerAnimated:YES completion:nil];
        return NO;
    }

}

@end

Looks like a typo to me. 对我来说似乎是一个错字。

// Phohes?
- (BOOL)PhohesViewController: (ABPeoplePickerNavigationController *)picker //Phohes? shouldContinueAfterSelectingPerson:(ABRecordRef)person

查看您的代码和发布的图像,您正在方法中定义一个方法,您不能这样做。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM