외규장각 도서 환수 모금 캠페인











Posted by 닉네임영역
,

#define Appdelegate ((AppDelegate *)[[UIApplication sharedApplication] delegate])

Posted by 닉네임영역
,

 //iCloud 막을 Document경로 설정

    NSString *documentPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMaskYESlastObject];

    NSURL *pathURL= [NSURL fileURLWithPath:documentPath];

    

    NSLog(@"%@",documentPath);

    

    if([[[UIDevice currentDevicesystemVersionfloatValue] > 5.0f){

        [self addSkipBackupAttributeToItemAtURL:pathURL];

    }else{

        NSLog(@"CANNOT - CUZ VERSION IS UNDER 5.0.1");

    }



//밑으로 애플에서 알려준 코드 URL에 경로
그래서 위에서 5.0.1버전 부터 호출 하도록하고
경로를 설정.

//Cloud Data 백업 방지...

- (BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)URL

{

    const char* filePath = [[URL pathfileSystemRepresentation];

    

    const char* attrName = "com.apple.MobileBackup";

    u_int8_t attrValue = 1;

    

    int result = setxattr(filePath, attrName, &attrValue, sizeof(attrValue), 00);

    return result == 0;

}


Posted by 닉네임영역
,

* 이렇게 싱글톤으로 안하고 직접 Prefix.pch에 바로 전역 선언으로 만들어 쓰는 방법도 있습니다. 


이제 선언했으니 함수에서 사용합니다.

@implementation Object

static Object *__sharedObject;

+ (Object *)sharedObject {

        if (__sharedObject == nil) {

                __sharedObject = [[Object alloc] init];

        }

        return __sharedObject;

}

@end

Posted by 닉네임영역
,
1. StoreKit.framework 라이브러리를 추가해줍니다 
2. 헤더파일에 #import <StoreKit/SKStoreProductViewController.h>를 추가합니다
3. SKStoreProductViewControllerDelegate 델리게이트를 추가해줍니다

[self presentAppStoreForID:[NSNumber numberWithInt:앱아이디inView:띄울 부모뷰(self.view) withDelegate:self withURL:[NSURLURLWithString:iOS6 이전 버전에 사용할 앱스토어 링크]];



- (void)presentAppStoreForID:(NSNumber *)appStoreID inView:(UIView *)view withDelegate:(id<SKStoreProductViewControllerDelegate>)delegate withURL:(NSURL *)appStoreURL

{

    if(NSClassFromString(@"SKStoreProductViewController")) { // iOS6 이상인지 체크


        SKStoreProductViewController *storeController = [[SKStoreProductViewController allocinit];

        storeController.delegate = delegate; // productViewControllerDidFinish


        NSDictionary *productParameters = @{ SKStoreProductParameterITunesItemIdentifier : appStoreID };



        [storeController loadProductWithParameters:productParameters completionBlock:^(BOOL result, NSError *error) {

            if (result) {

                [self presentViewController:storeController animated:YES completion:nil];

            } else {

                [[[UIAlertView allocinitWithTitle:@"연결 실패" message:@"앱을 불러올  없습니다." delegate:nil cancelButtonTitle:@"확인"otherButtonTitlesnil] show];

            }

        }];

    } else { // iOS6 이하일 

        [[UIApplication sharedApplicationopenURL:appStoreURL];

    }

}


// 닫을 때 

- (void)productViewControllerDidFinish:(SKStoreProductViewController *)viewController {

    [viewController dismissModalViewControllerAnimated:YES];

}


Posted by 닉네임영역
,

해당 버튼에 다음과 같이 옵션을 주면 됨.


self.btn.layer.borderWidth = 1.0f;

self.btn.layer.cornerRadius = 20.0f;

Posted by 닉네임영역
,

#define IS_4_INCH_DEVICE CGSizeEqualToSize([UIScreen mainScreen].bounds.size, CGSizeMake(320, 568)) || CGSizeEqualToSize([UIScreen mainScreen].bounds.size, CGSizeMake(568, 320))


#define ISRETINA ([[UIScreen mainScreen] respondsToSelector:@selector(scale)])?([[UIScreen mainScreen] scale] == 2.0):(0)


*.pch 파일에 붙여 넣기


if(IS_4_INCH_DEVICE) {

// 4inch

}

else {

// 3.5inch

}


if(ISRETINA) {

// 4inch

}

else {

// 3.5inch

}

Posted by 닉네임영역
,



Project > Build Setting

Apple LLVM 5.0 - Language - Objective C

Objective-C Automatic Reference Counting(ARC) 기본이 YES로 되어 있는데 이걸 NO로 변경

Posted by 닉네임영역
,



1.http://www.eclipse.org/downloads 에서 원하는 버전의 이클립스 다운


2. 다운받은 파일 압축 해제


3. 이클립스 실행


4. mac에서 자동으로 자바 런타임 설치(예전에는 없었는데 요즘 다시 설치하려니 생김)


5. 안드로이드 개발도구 설치(ADT - Android Development Tool)

- 이클립스 실행

- Help > install New Software 선택

- 오른쪽 상단의 Add 클릭

- Name은 아무거나

- Location : https://dl-ssl.google.com/android/eclipse 입력 후 OK 클릭

- 목록 노출되는 모든 것 선택 후 Next

- 설치할 목록 나온것 선택 후 Next

- 쭉 실행

- 설치 완료 후 재부팅


6. 재부팅 후 Android SDK 설치 창이 뜸 - 설치 진행


7. eclipse메뉴 window > Android SDK Manager 실행

- 안보일 경우 없는게 아니고 숨겨져 있음

- 노출 방법

- Window > Customize Perspective > Command Groups Availability > Android SDK Manager and AVD Manager 선택 후 OK 클릭

Posted by 닉네임영역
,

script File - copy bundle resources 추가


일반 파일 추가 후 다음과 같이 하면 화면에 html파일 로드

NSString *path = [[NSBundle mainBundle] pathForResource:@"a" ofType:@"html"];

NSURL *url = [NSURL fileURLWithPath:path];

NSURLRequest *request = [NSURLRequest requestWithURL:url];

[self.webView loadRequest:request];


warning: no rule to process file '$(PROJECT_DIR)/SNSDemo_Hybrid/jquerymobile.js' of type sourcecode.javascript for architecture i386

위와 같이 경고가 나타날때가 있다.

이럴땐 다음과 같이 하면 된다.

Build Phases - Compile resources에 있는 *.js파일을 Copy Bundle Resources로 옮기던지 아니면 삭제.


orientation에 따른 stylesheet의 변경

<link rel="stylesheet" media="all and (orientation:landscape)" href="userStylesheet_landscape.css"/>

<link rel="stylesheet" media="all and (orientation:portrait)" href="userStylesheet_portrait.css"/>


portrait / landscape 알아서 css 참조를 변경한다.



Posted by 닉네임영역
,


사랑합니다. 편안히 잠드소서