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

1. terminal 실행

- sudo gem install cocoapods(시간 좀 걸림)

- pod setup(시간 좀 걸림)

- Performing a deep fetch of the 'master' specs repo to improve performance 나오면 rm -fr ./cocoapods/repos/master 후 다시 pod setup

2. workspace create

3. project create

4. workspace에 3번 생성한 project add

5. terminal에서 workspace와 proect가 있는 폴더로 이동

6. pod init(Podfile 생성 확인)

7. Podfine 수정 (라이브러리 소스로 추가)

8. terminal에서 pod install(다운로드 확인)

9. #import <>

10. swift인 경우 use_framework! 추가

Posted by 닉네임영역
,

따따디씨에서 새로운 언어(?)를 발표했다. 

스위프트란다.

기존 코드들에 대해 확 줄어들게 코딩할 수 있다던데 

오늘 맛좀 봤다.

머든지 그렇겠지만 익숙해지면 편할듯

유니코드 지원으로 변수명 한글이 된다.

변수명을 변수라고 해봤다. 잘된다...ㅋㅋㅋ


다만 아직은 xcode6 - beta라서 자동완성 기능이 원활하지 않다.

스토리보드도 해야 하는데 스위프트까지 ;;;;

간단한 tutorial을 링크를 참조 하시길


http://text.youknowone.org/post/87652586691/swift-list

https://www.penflip.com/jjuakim/swift-korean

Posted by 닉네임영역
,

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

- (NSMutableDictionary *)resourcesCheck {

    NSString* bundlePath = [[NSBundle mainBundle] bundlePath];

    NSDirectoryEnumerator *enumerator = [[NSFileManager defaultManager] enumeratorAtPath:bundlePath];

    NSString *filePath;

    NSMutableDictionary *mArray = [[NSMutableDictionary alloc] init];

    

    while ((filePath = [enumerator nextObject]) != nil) {

        if (![[filePath pathExtension] isEqualToString:@"nib"]){

            NSString *path = [bundlePath stringByAppendingPathComponent:filePath];

            NSData *nsData = [NSData dataWithContentsOfFile:path];

            if (nsData)

                NSLog(@"%@", [nsData MD5]);

            [mArray setObject:[nsData MD5] forKey:filePath];

        }

    }

    

    return mArray;

}

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

#import "NSString+MD5.h"

 

@interface NSString(MD5)

 

- (NSString *)MD5;

 

@end

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

#import <CommonCrypto/CommonDigest.h>

 

@implementation NSString(MD5)

 

- (NSString*)MD5

{

// Create pointer to the string as UTF8

  const char *ptr = [self UTF8String];


  // Create byte array of unsigned chars

  unsigned char md5Buffer[CC_MD5_DIGEST_LENGTH];


// Create 16 bytes MD5 hash value, store in buffer

  CC_MD5(ptr, strlen(ptr), md5Buffer);


// Convert unsigned char buffer to NSString of hex values

  NSMutableString *output = [NSMutableString stringWithCapacity:CC_MD5_DIGEST_LENGTH * 2];

  for(int i = 0; i < CC_MD5_DIGEST_LENGTH; i++) 

[output appendFormat:@"%02x",md5Buffer[i]];


  return output;

}

 

@end

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

#import "NSData+MD5.h"

 

@interface NSData(MD5)

 

- (NSString *)MD5;

 

@end

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

#import <CommonCrypto/CommonDigest.h>

 

@implementation NSData(MD5)

 

- (NSString*)MD5

{

  // Create byte array of unsigned chars

  unsigned char md5Buffer[CC_MD5_DIGEST_LENGTH];


// Create 16 byte MD5 hash value, store in buffer

  CC_MD5(self.bytes, self.length, md5Buffer);

    

// Convert unsigned char buffer to NSString of hex values

  NSMutableString *output = [NSMutableString stringWithCapacity:CC_MD5_DIGEST_LENGTH * 2];

  for(int i = 0; i < CC_MD5_DIGEST_LENGTH; i++) 

[output appendFormat:@"%02x",md5Buffer[i]];


  return output;

}

 

@end

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


Posted by 닉네임영역
,


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