Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4321534
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T08:45:29+00:00 2026-05-21T08:45:29+00:00

I have encrypted documents. After unarchiving each document, I need to prompt the user

  • 0

I have encrypted documents. After unarchiving each document, I need to prompt the user to enter the document password from a logon sheet. I have means to validate password entry against file contents (this part is done). If the password is incorrect the document shall be closed. If the password is correct the document window shall be presented with document contents.

When I attempt to load the logon sheet (via its controller) in the document’s windowControllerDidLoadNib method I have unrecognized selector error as shown below:

- (void)windowControllerDidLoadNib:(NSWindowController *)aController
{
    [super windowControllerDidLoadNib:aController];

    if (!newPasswordController){
        newPasswordController = [[NewPasswordController alloc] init];
        newPasswordSheet = [newPasswordController window];
    }
    [NSApp beginSheet:newPasswordSheet modalForWindow:[self window]
        modalDelegate:self
       didEndSelector:@selector(didNewPasswordEnd:returnCode:contextInfo:) 
          contextInfo:nil];

}

[_NSControllerObjectProxy copyWithZone:]: unrecognized selector sent to instance 

The method [NewPasswordController init] is implemented as follows:

-(id)init
{
    self = [super initWithWindowNibName:@"NewPassword"];
    if (self) {
    }
    return self;
}

where the logon sheet nib file is called NewPassword.

I wonder what went wrong. What is the best way to solve this problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T08:45:30+00:00Added an answer on May 21, 2026 at 8:45 am

    Aside from unrecognized selector issue (which I left with Apple) I managed to address the original issue Prompting the user to logon for encrypted documents and here is the solution.

    Note every document is password protected and they could potentially respond to different passwords (so the issue is not ‘password protected application’ but ‘password protected documents’).

    Simply inject the following code when we are about to read document contents to pop up an application modal window to verify the document password:

    - (BOOL)readFromData:(NSData *)data 
            ofType:(NSString *)typeName 
            error:(NSError **)outError 
    {
       PasswordController *passwordController = [[PasswordController alloc] init];
       NSWindow *passwordSheet = [passwordController window];
    
       NSApplication* app = [NSApplication sharedApplication];
       NSInteger iret = [app runModalForWindow:passwordSheet];
       NSLog(@"password dialog returned = %ld", iret);
       if (iret != 0)
       {
           [app stop:self];
           return NO;
       }
       [passwordController release];
       ...
    

    You may also pop up another kind of window when the document is saved the first time in dataOfType, forcing the user to set the document’s password.

    This issue is answered now.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a pgp-encrypted file that I need to extract data from at runtime.
I have a PDF document that has an owner password set but no user
I have a large subset of encrypted word documents which i need to process
I have an application that stores an XML Encrypted Document, each time the application
I have an encrypted bit of text that I need to decrypt. It's encrypted
I have an script that receives an encrypted url and from that generates a
I have an encrypted word/excel/pdf file locally stored which I need to preview in
I have an encrypted parameter V coming from a web page like this: page.php?V=5E5C535C584B40584A4A4E564B5D4503510755020402080C580A015D0D0A5A010206070C0E025C000F005D080E5F5D
I have encrypted back-end ACCDB on Win/2003 network. Front-end on user workstations. Link tables
I have an encrypted query string passed from another page, it reads something like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.