흠..정말 오랜만에 블로그에 글을 남기네요..

근데....희한하군요-_-;;

왜 이렇게 방문자가 많지;;

하루 방문자가 150명이 넘었네요..-_-;;;;;

이거 은근히 기분 좋네..이래서 블로그를 운영하나ㅋㅋㅋ

방문해주신 모든 분들 


"새해 복 많이 받으십시요~"


주인장 올림

'산들바람의이야기' 카테고리의 다른 글

구글 애드센스의 수익..ㅋㅋ  (0) 2013.06.10
오랜만에 들어왔더니..  (0) 2013.05.06
안철수교수님 서울 시장 출마설..  (0) 2011.09.02
중국 짝퉁의 위력..  (0) 2011.06.29
임금체불..  (3) 2011.05.11
      
Posted by k_ben


1. 일반적인 로딩
NSString * address = @http://www.naver.com;
NSURL *url = [[NSURL alloc]initWithString:address];
NSURLRequest * request = [NSURLRequest requestWithURL:url];
[mWebView loadRequest:request];


2. javascript 실행
NSMutableString * javascript = [NSMutableString stringWithString:@"alert('');"];
[mWebView stringByEvaluatingJavaScriptFromString:javascript];

3. WebView에 Post 데이터 실어보내기!!
NSString * address = @http://www.naver.com;
NSURL *url = [[NSURL alloc]initWithString:address];

NSString *postdata = [NSString stringWithFormat:@"post=%@", @"data"];
NSMutableURLRequest *request = [NSMutableURLRequest alloc]initWithURL:url];
[request setHTTPMethod:@"POST"];
[request setHTTPBody:[postdata dataUsingEncoding:NSUTF8StringEncoding]];
[mWebView loadRequest:request];


4. JS file
you can also call a JS file from a bundle (get around that readability snag and have as many fnctions as you need)….
NSString *filePath = [[NSBundle mainBundle] pathForResource:@”loco” ofType:@”js” inDirectory:@”"];

NSData *fileData = [NSData dataWithContentsOfFile:filePath];

NSString *jsString = [[NSMutableString alloc] initWithData:fileData encoding:NSUTF8StringEncoding];

[webby stringByEvaluatingJavaScriptFromString:jsString];

      
Posted by k_ben


페이스 북

필요한 프레임워크

Accounts.framework

Social.framework

Adsupport.framework

FacebookSDK.framework

번들 파일도 추가함 : FacebookSDKResources.bundle      FBUserSettingsViewResources.bundle

appdelete.m파일/////////facebook연동시 필요한 부분////////////
- (void)applicationDidBecomeActive:(UIApplication *)application
{
    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
    [FBSession.activeSession handleDidBecomeActive];
}

- (BOOL) application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
    return [FBSession.activeSession handleOpenURL:url];
}

- (void)applicationWillTerminate:(UIApplication *)application
{
    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
    [FBSession.activeSession close];
}
/////////facebook연동시 필요한 부분////////////

구현할 파일에 가서

#import <FacebookSDK/FacebookSDK.h>

<FBLoginViewDelegate>

//////소스 구현 부분/////

UIImage *img = picImg.image;
        
        // if it is available to us, we will post using the native dialog
        BOOL displayedNativeDialog = [FBNativeDialogs presentShareDialogModallyFrom:self
                                                                        initialText:contentText.text
                                                                              image:img
                                                                                url:nil
                                                                            handler:nil];
        
        NSMutableDictionary * postParams =  [[NSMutableDictionary alloc] initWithObjectsAndKeys:
                                             @"photo description", @"name",
                                             nil];
        [postParams setObject:picImg.image forKey:@"picture"];
        [postParams setObject:contentText.text forKey:@"message"];
        NSLog(@"param = %@", postParams);
        
        if (!displayedNativeDialog) {
            [self performPublishAction:^{
                
                [FBRequestConnection startWithGraphPath:@"me/photos" parameters:postParams HTTPMethod:@"POST" completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
                    NSLog(@"error = %@", error);
                }];
                
            }];
        }

//////소스 구현 부분/////

target에서 info 부분 수정

FacebookAppID ---> 311092382324995(앱id)

url types ----> fd311092382324995(앞에 fd붙이고 앱id)

////////////////////////////////////////////////

트위터 연동

필요한 프레임워크

Twitter.framework

MobileCoreServices.framework

#import <Twitter/TWTweetComposeViewController.h>
#import <MobileCoreServices/MobileCoreServices.h>

TWTweetComposeViewController *tweetView;

@property (nonatomic, strong) TWTweetComposeViewController *tweetView;

구현할 소스 부분/////////////////////////

if ([TWTweetComposeViewController canSendTweet]) {
           
            TWTweetComposeViewController *twtCntrlr = [[TWTweetComposeViewController alloc] init];
//            [twtCntrlr addURL:[NSURL URLWithString:_shareURL]];
            [twtCntrlr addImage:picImg.image];
            [twtCntrlr setInitialText:contentText.text];
           
            [self presentModalViewController:twtCntrlr animated:YES];
        }

/////////////////////////

      
Posted by k_ben