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

  • Home
  • SEARCH
  • 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 7589819
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:15:19+00:00 2026-05-30T20:15:19+00:00

I have integrated evernote in my application by downloading sample code from its site.

  • 0

I have integrated evernote in my application by downloading sample code from its site. It otherwise works fine, only that it has a singleton class which contains static values of username and password. The .h file of this class looks like this

extern NSString * const username; 
extern NSString * const password; 
@interface Evernote : NSObject {
    Evernote *sharedEvernoteManager;
    }

in .m file

    NSString * const username = @"username";
    NSString * const password = @"password"; 

@implementation Evernote
    /************************************************************
     *
     *  Connecting to the Evernote server using simple
     *  authentication
     *
     ************************************************************/

    - (void) connect {

        if (authToken == nil) 
        {      
            // In the case we are not connected we don't have an authToken
            // Instantiate the Thrift objects
            NSURL * NSURLuserStoreUri = [[[NSURL alloc] initWithString: userStoreUri] autorelease];

            THTTPClient *userStoreHttpClient = [[[THTTPClient alloc] initWithURL:  NSURLuserStoreUri] autorelease];
            TBinaryProtocol *userStoreProtocol = [[[TBinaryProtocol alloc] initWithTransport:userStoreHttpClient] autorelease];
            EDAMUserStoreClient *userStore = [[[EDAMUserStoreClient alloc] initWithProtocol:userStoreProtocol] autorelease];


            // Check that we can talk to the server
            bool versionOk = [userStore checkVersion: applicationName :[EDAMUserStoreConstants EDAM_VERSION_MAJOR] :    [EDAMUserStoreConstants EDAM_VERSION_MINOR]];

            if (!versionOk) {
               // Alerting the user that the note was created
                UIAlertView *alertDone = [[UIAlertView alloc] initWithTitle: @"Evernote" message: @"Incompatible EDAM client protocol version" delegate: self cancelButtonTitle: @"Ok" otherButtonTitles: nil];

                [alertDone show];
                [alertDone release];

                return;
            }


            // Returned result from the Evernote servers after authentication
            EDAMAuthenticationResult* authResult =[userStore authenticate:username :password : consumerKey :consumerSecret];

            // User object describing the account
            self.user = [authResult user];
            // We are going to save the authentication token
            self.authToken = [authResult authenticationToken];
            // and the shard id
            self.shardId = [user shardId];

            // Creating the user's noteStore's URL
            noteStoreUri =  [[[NSURL alloc] initWithString:[NSString stringWithFormat:@"%@%@", noteStoreUriBase, shardId] ] autorelease];

            // Creating the User-Agent
            UIDevice *device = [UIDevice currentDevice];
            NSString * userAgent = [NSString stringWithFormat:@"%@/%@;%@(%@)/%@", applicationName,applicationVersion, [device systemName], [device model], [device systemVersion]]; 


            // Initializing the NoteStore client
            THTTPClient *noteStoreHttpClient = [[[THTTPClient alloc] initWithURL:noteStoreUri userAgent: userAgent timeout:15000] autorelease];
            TBinaryProtocol *noteStoreProtocol = [[[TBinaryProtocol alloc] initWithTransport:noteStoreHttpClient] autorelease];
            noteStore = [[[EDAMNoteStoreClient alloc] initWithProtocol:noteStoreProtocol] retain];

        }
    }

I need to make the username and password dynamic so that I can use values from textfields as follows

 NSString * const username = usernametextfiled.text;
    NSString * const password = passwrdfiled.text; 

I am getting error that says we cannot add text field before @implementation. How to solve this issue?

  • 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-30T20:15:21+00:00Added an answer on May 30, 2026 at 8:15 pm
    @interface Evernote : NSObject
    ...
    
    
    @property(retain) NSString * username;
    
    @property(retain) NSString * password;
    

    then

    @implementation Evernote
    
    
     @synthesize username;
     @synthesize password;
    

    then you can set them using

    [[Evernote sharedEvernoteManager]setusername:yourvariable];
    [[Evernote sharedEvernoteManager]setpassword:yourvariable];
    

    do remember to release the variable in dealloc

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

Sidebar

Related Questions

I have integrated galeria to show images in my cakephp application.It works fine.But after
I have integrated the below code in my application to generate a 'pdf' file
I have integrated the sample code as provided in here to know how the
I have integrated the facebook in to my application, From the FB i will
I have integrated Facebook into my Android application. It was worked fine before last
http://code.google.com/p/django-threadedcomments/,I have integrated the the following Blog APP with my site.In the URLs.py i
I have a WPF application that we have integrated credit card processing into. We're
I have integrated a library that uses AVCaptureSession to capture a photo from the
I have integrated a Silverlight Navigation Application in an ASP.NET MVC web. However when
We have integrated ELMAH with ASP.NET MVC 3, as a way to log application

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.