본문 바로가기

IOS

[IOS Library] 이미지에서 색상값 추출 LEColorPickerA Cocoa-Touch system for getting a color scheme in function of an image, like iTunes 11 does. It is designed as a general purpose class set, in wich LEColorPicker is the interface for your client code. 이동하기 더보기
[iOS] capturing self strongly in this block is likely to lead to a retain cycle 아래와 같은 패턴에서 block 안에서 self를 사용하게 되면 capturing self strongly in this block is likely to lead to a retain cycle 라는 경고가 뜨게 된다. 그럴 때에는 __weak typeof(self) weakSelf = self; ^(NSDictionary *dic) {self.~~~~~~ 이렇게 쓰지말고 weakSelf.~~~~~~ 이렇게 쓰자 } 더보기
[iOS] NSString URLEncoding 하기 iOS에서 제공해주는 [str stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; 메소드의 경우 문제가 많고 버그도 있다라는 것으로 알려져있다. 한 가지 예시로 이메일 abcd@asbd.com을 Encoding해보면 결과가 그대로 출력되는 것을 알 수 있다. 위의 방법을 대체 할 수 있는 방법은 @interface NSString (URLEncoding) -(NSString *)urlEncodeUsingEncoding:(NSStringEncoding)encoding; @end @implementation NSString (URLEncoding) -(NSString *)urlEncodeUsingEncoding:(NSStringEncoding).. 더보기
[iOS] NSLocalizedString 사용해보기~! Localizable.strings 의 파일을 준비하자~! (반드시 이름도 같아야 한다.) 이런 식으로 Key Value 형식으로 쓰고..."CHECK_FACEBOOK_ACCOUNT" = "Please check your Facebook account (Home->Settings->Facebook)"; "CHECK_TWITTER_ACCOUNT" = "Please check your Twitter account (Home->Settings->Twitter)"; 코드에서는 아래와 같이 사용하면 된다.~!NSLocalizedString(@"CHECK_FACEBOOK_ACCOUNT", nil) 더보기
[iOS] twitter iOS 단말기에 있는 유저 정보 가져오기 프레임워크는 Social.framework 와 Accounts.framework가 필요하다. m_accountStore = [[ACAccountStore alloc] init];[m_accountStore requestAccessToAccountsWithType:twitterAccountType options:nil completion:^(BOOL granted, NSError *error) { if (granted) { NSArray *accounts = [m_accountStore accountsWithAccountType:twitterAccountType]; ACAccount *twitterAccount = [accounts lastObject]; NSDictionary *params = [NSDi.. 더보기
[iOS] facebook iOS 단말기에 있는 유저 정보 가져오기 Facebook SDK를 사용하지 않고 단말기에서 내부적으로 연동되어있는 아이디 정보를 가져오는 방법이다.프레임워크는 Social.framework 와 Accounts.framework를 추가해야 한다. m_accountStore = [[ACAccountStore alloc] init];ACAccountType *facebookAccountType = [m_accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook];NSDictionary *options = @{ACFacebookAppIdKey : s_facebookApiKey, ACFacebookPermissionsKey : @[@"email"], ACFaceboo.. 더보기
[iOS] performselector may cause a leak because its selector is unknown 아래와 같은 코드에서 performselector may cause a leak because its selector is unknown 이라는 경고가 뜨면 SEL selector = ~~~~[self performSelector:selector]; 아래와 같이 바꾸면 경고가 없어진다.[self performSelector:selector withObject:nil afterDelay:0]; 더보기
[iOS] 기본 UI 색깔 변경하기 원래 iOS7의 기본 UI 색깔은 연한 파란색? 이다. 이것을 아래의 그림처럼 내가 정한 색깔로 바꾸고 싶다면... 바꾸고 싶은 Component의 tintColor를 바꿔준다. UIColor * tintColor = [UIColor colorWithRed:76.0/255.0 green:19.0/255.0 blue:136.0/255.0 alpha:1.0]; self.window.tintColor = tintColor; [UIButton appearance].tintColor = tintColor; [[UIButton appearance] setTitleColor:tintColor forState:UIControlStateNormal]; [UISwitch appearance].tintColor = tint.. 더보기
[IOS Library] List Dialog android 스타일?의 Dialog 창이다. 괜찮은듯하다. 이동하기 더보기
[iOS] iOS 증명서 만들기 이번에 새롭게 개발자 계정을 연장시키면서 증명서를 발급해야되는 일이 생겨서 같이 정리를 해봤다. 1. 아래와 같이 생성하라고 한다. 여기서 Create Signing Request 를 누르자 2. 본인은 개발자 증명서를 만들어야하기에 아래의 항목을 선택 3. 현재의 맥의 CSR파일을 만들자~! 4. 키체인에서~ 아래와 같이 선택 5. Email 과 이름을 입력한다. 그리고 Saved to disk 선택한다. 그리고 저장 6. 3번 항목에서 다음을 누르면 방금 만든 CSR파일을 업로드하라고 한다. 7. 업로드를 하고 나면 증명서가 만들어진다. 더보기