2012-01-25 6 views
1

私はevernoteとメモを同期することができるrederアプリケーションを実行しています。私はAPIとサンプルコードを見つけました。私は自分のアプリケーションを統合し、out.Newsに従って作成しました。私たちは、静的で、ユーザー名とパスワードを与える必要がevernoteclass.m service.in生産はこのiOSのEvernoteとの統合

#import "Evernote.h" 
NSString * const username = @"usernme"; 
NSString * const password = @"pswrd123"; 

NSString * const userStoreUri = @"https://sandbox.evernote.com/edam/user"; 
NSString * const noteStoreUriBase = @"https://sandbox.evernote.com/edam/note/"; 
@implementation Evernote 

のようなコードがあるが、私は私達のログインページのようにユーザー名とパスワードのテキストフィールドを使用してこれを実装する必要があります。 この値を静的に追加すると、私はメモをevernoteに送ることができます textfiledsを使って動的にユーザ名を与える方法。ありがとうございます。

答えて

1

最新のevernote ios sdkでは、oauthによる認証を得ることができます。

// set up Evernote session singleton 
[EvernoteSession setSharedSessionHost:EVERNOTE_HOST 
          consumerKey:EVERNOTE_CONSUMER_KEY 
         consumerSecret:EVERNOTE_CONSUMER_SECRET]; 
EvernoteSession *session = [EvernoteSession sharedSession]; 
[session authenticateWithCompletionHandler:^(NSError *error) { 
    if (error || !session.isAuthenticated) { 
     UIAlertView *alert = [[[UIAlertView alloc] initWithTitle:@"Error" 
                 message:@"Could not authenticate" 
                 delegate:nil 
               cancelButtonTitle:@"OK" 
               otherButtonTitles:nil] autorelease]; 
     [alert show]; 
    } else { 
     DLog(@"Evernote auth ready"); 
     [self _authDidCompleted]; 
    } 
}]; 
+0

#ifdef DEBUG #define EVERNOTE_HOST @ "sandbox.evernote.com" #else #define EVERNOTE_HOST @ "www.evernote.com" #endif – Slavik

0

ユーザー名用とパスワード用の2つのテキストフィールドを作成します。 IBOutletsも作成します。次に、あなたは次のコードを書くことができます

NSString * const username = textField1.text; 
NSString * const password = textField2.text; 

私は実際にあなたの質問を正しく持っているかわかりません。しかし、これが助けてくれることを願って.....

+0

Alphaでは@Aですが、evernote.hはnsobjectです。nsobjectでテキストファイルを作成するにはどうすれば可能ですか? – stackiphone