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

* 이렇게 싱글톤으로 안하고 직접 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 닉네임영역
,


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