'분류 전체보기'에 해당되는 글 333건

  1. 2013.08.15 [objc] UINavigationController에서 UIViewController 얻기
  2. 2013.08.13 [mac] terminal에서 현재 위치 finder로 열기
  3. 2013.08.12 [objc] AssetsLibrary sample
  4. 2013.07.29 [git] 파일지정해서 이전의 소스로 되돌리기.
  5. 2013.07.29 [objc] link를 포함함 Label
  6. 2013.07.26 [objc] NSString, replace
  7. 2013.07.26 [objc] UIWebView, 배경을 투명하게
  8. 2013.07.19 [objc] UITextView 높이 구하기
  9. 2013.07.19 [etc] Facebook, Twitter 프로필 이미지 사이즈
  10. 2013.07.17 [objc] UITextView, 복사/붙여넣기 팝업이 안나오는 UITextView 만들기
  11. 2013.07.16 [etc] git commit 메세지 수정
  12. 2013.07.16 [objc] UITableView, scroll만 가능하게
  13. 2013.07.10 [objc] UITextView, url link
  14. 2013.07.10 [objc] 제스쳐, 싱글탭 더블탭 동시에, gesture, single tap, double tap
  15. 2013.07.02 [objc] frame, layout, CGRect, 레이아웃 재정의
  16. 2013.06.30 [objc] strings file, localize
  17. 2013.06.26 [objc] Album, privacy alert
  18. 2013.06.23 [javascript] button event
  19. 2013.06.10 [objc] JSON 문자열, 파싱
  20. 2013.06.07 [objc] 단말이 플래시가 있는지 체크하기
  21. 2013.06.06 [objc] UITextField, placeholder만 사이즈 바꾸기
  22. 2013.06.06 [objc] UITextField, textField:shouldChangeCharactersInRange:replacementString:에서 수정후의 문자열 얻기
  23. 2013.06.04 [objc] UILabel align left top
  24. 2013.06.04 [GoogleDoc] 셀비교
  25. 2013.05.31 [objc] UIWebView, Network check
  26. 2013.05.31 [objc] UIWebViewDelegate가 안먹는다?
  27. 2013.05.30 [objc] UIWebView, cache
  28. 2013.05.30 ISO 국가코드
  29. 2013.05.30 [objc] UILabel, line
  30. 2013.05.30 [objc] use Autolayout





UIViewController *targetView = [[self.navigationController viewControllers] objectAtIndex:0];  

//0(root)〜depth



Posted by tenn
,



open .



Posted by tenn
,

[objc] AssetsLibrary sample

iPhone 2013. 8. 12. 14:44



http://pentacreation.com/blog/2012/12/121208.html

Posted by tenn
,

git checkout [commit번호] [file...]



Posted by tenn
,


link색깔을 바꿀수도 있음.

height 조절할 때, 먼저 최대화 해준후, sizeToFit


OHAttributedLabel


https://github.com/AliSoftware/OHAttributedLabel

Posted by tenn
,

[objc] NSString, replace

iPhone 2013. 7. 26. 12:41
- (NSString *)stringByReplacingOccurrencesOfString:(NSString *)target 
                                        withString:(NSString *)replacement


http://stackoverflow.com/questions/668228/string-replacement-in-objective-c

Posted by tenn
,



[webView setBackgroundColor:[UIColor clearColor]];
[webView setOpaque:NO];


http://stackoverflow.com/questions/8667150/uiwebview-background-is-set-to-clear-color-but-it-is-not-transparent

Posted by tenn
,



CGSize textViewSize = [text sizeWithFont:[UIFont fontWithName:@"Marker Felt" size:20] 
                       constrainedToSize:CGSizeMake(WIDHT_OF_VIEW, FLT_MAX) 
                       lineBreakMode:UILineBreakModeTailTruncation];



http://stackoverflow.com/questions/7401445/how-to-set-height-of-uitextview-according-to-its-content-in-objective-c

Posted by tenn
,

** 페이스북


프로필이미지 구하기

http://graph.facebook.com/[facebook id]/picture?type=large


small    50x50

normal    100x100

large    180x180



** 트위터

http://a0.twimg.com/profile_images/3441454604/cffb106a40dd3b574fdc6b6424944c34_normal.jpeg

url의 normal을 bigger나 mini로 바꾸어주면 이미지를 얻을수 있다.


bigger : 73 x 73

normal : 48 x48

mini : 24 x 24

Posted by tenn
,


사용하려는 클래스의 .m파일 끝에 붙이면 됨.


@implementation UITextView (DisableCopyPaste)

- (BOOL)canBecomeFirstResponder
{
    return NO;
}

@end



http://stackoverflow.com/questions/1426731/how-disable-copy-cut-select-select-all-in-uitextview

Posted by tenn
,


git commit --amend -m "your new message"


http://stackoverflow.com/questions/179123/how-do-i-edit-an-incorrect-commit-message-in-git


Posted by tenn
,


    NSArray *cells = self.tableView.visibleCells;

    for(UITableViewCell *cell in cells){

        cell.userInteractionEnabled = NO;

    }


*** 이렇게 하면 보이는 셀만 잠근다.

스크롤 하면 재사용해서 셀을 돌리기 때문에 꼬인다.

셀을 생성하는 구문도 수정필요.

Posted by tenn
,

[objc] UITextView, url link

iPhone 2013. 7. 10. 19:09



textview.editable = NO;
textview.dataDetectorTypes = UIDataDetectorTypeAll;


http://stackoverflow.com/questions/995219/how-to-make-uitextview-detect-links-for-website-mail-and-phone-number



Posted by tenn
,


// ****** gesture recognizers ******

{   // single tap    
    UITapGestureRecognizer *single_tap_recognizer;

    single_tap_recognizer = [[[UITapGestureRecognizer alloc] 
                    initWithTarget : table_view_controller  
                    action         : @selector(upper_button_view_tapped:)]
                    autorelease];

    [single_tap_recognizer setNumberOfTouchesRequired : 1];
    [u_buttons_view addGestureRecognizer : single_tap_recognizer];


    // double tap 
    UITapGestureRecognizer *double_tap_recognizer;

    double_tap_recognizer = [[[UITapGestureRecognizer alloc] 
                     initWithTarget : table_view_controller  
                     action         : @selector
                              (upper_button_view_double_tapped:)]
                     autorelease];        

    [double_tap_recognizer setNumberOfTouchesRequired : 2];

    [single_tap_recognizer requireGestureRecognizerToFail : double_tap_recognizer]; 

    [u_buttons_view addGestureRecognizer : double_tap_recognizer];



http://stackoverflow.com/questions/8876202/uitapgesturerecognizer-single-tap-and-double-tap

Posted by tenn
,

     


UIView *a = ...


        CGRect target = a.frame;

        a.frame = CGRectMake(target.origin.x, target.origin.y, target.size.width, target.size.height);



간단히..

CGRect target = a.frame;

target.origin.x = 0;

target.size.width = 100;

a.frame = target;




Posted by tenn
,

Localize를 위한 스트링파일 읽기.


self.title = NSLocalizedString(@"MainViewTitle", @"");


http://userflex.wordpress.com/2011/10/20/localized-strings-xcode4/


Posted by tenn
,

[objc] Album, privacy alert

iPhone 2013. 6. 26. 12:22

Album Privacy 설정 경고창을 표시.

(설정안하면 경고창, 설정했으면 표시안함)

iOS6이상.. (5이하는 앨범프라이버시 설정이 안된다)


ALAssetsLibrary *lib = [[ALAssetsLibrary alloc] init];

[lib enumerateGroupsWithTypes:ALAssetsGroupSavedPhotos usingBlock:^(ALAssetsGroup *group, BOOL *stop) {
    NSLog(@"%i",[group numberOfAssets]);
} failureBlock:^(NSError *error) {
    if (error.code == ALAssetsLibraryAccessUserDeniedError) {
        NSLog(@"user denied access, code: %i",error.code);
    }else{
        NSLog(@"Other error code: %i",error.code);
    }
}];

http://stackoverflow.com/questions/13572220/ask-permission-to-access-camera-roll

Posted by tenn
,

[javascript] button event

HTML5 2013. 6. 23. 14:27

<script type="text/javascript">

function a(){

  alert('Alert');

}

</script>



<input type="button" value="click me" onclick="a();" >



Posted by tenn
,



    NSString *str = @"{\"flg\":\"1\"}";

    NSData *data = [str dataUsingEncoding:NSUTF8StringEncoding];

    NSError *err = nil;

    id result = [NSJSONSerialization JSONObjectWithData:data options:0 error:&err];

    NSDictionary *dic = result;

    NSString *p1 = [dic objectForKey:@"flg"];

    NSLog(@"%@", p1);

Posted by tenn
,



AVCaptureDevice *device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];

if([device hasTorch])

{

...

}



http://stackoverflow.com/questions/15247175/how-to-find-out-camera-flash-is-available-in-iphone

Posted by tenn
,


//뷰가 로드될때, UITextField에 placeholder의 폰트 사이즈 지정


//UITextFieldDelegate


- (BOOL)textFieldShouldClear:(UITextField *)textField{

//placehoder사이즈를 UITextField에 지정

return YES;

}


- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {


...

 

        NSString *changedStr = [textField.text stringByReplacingCharactersInRange:range withString:string];

        

        if([changedStr isEqualToString:@""]){

            //placehoder사이즈를 UITextField에 지정

        }else{

            //입력문자 사이즈를 UITextField에 지정

        }


return YES;


}

Posted by tenn
,




- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {


...


    NSString *changedStr = [textField.text stringByReplacingCharactersInRange:range withString:string];

    return YES;


}

Posted by tenn
,

UILabel이 중앙정렬때문에 레이아웃이 자꾸깨져 짜증남.

sizeToFit로 해결됨. 아주 깨끗히


UILabel 

sizeToFit



http://stackoverflow.com/questions/1054558/vertically-align-text-within-a-uilabel

Posted by tenn
,

[GoogleDoc] 셀비교

etc 2013. 6. 4. 17:43

A1셀과 B1셀을 비교.


=EXACT(A1,B1)


결과 : TRUE, FALSE



Posted by tenn
,


- (BOOL) connectedToInternet

{

    NSString *URLString = [NSString stringWithContentsOfURL:[NSURL URLWithString:@"http://www.google.com"]];

    return ( URLString != NULL ) ? YES : NO;

}





stringWithContentsOfURL <- 요놈이 deprecated됨.


NSError* error = nil;
NSString* text = [NSString stringWithContentsOfURL:TheUrl encoding:NSASCIIStringEncoding error:&error];
if( text )
{
    NSLog(@"Text=%@", text);
}
else 
{
    NSLog(@"Error = %@", error);
}


http://stackoverflow.com/questions/2039203/what-is-the-stringwithcontentsofurl-replacement-for-objective-c

Posted by tenn
,

NSObject에 <UIWebViewDelegate>선언하고

웹뷰의 델레게이트에 연결해도 안먹길래..

뭔가 수상해서.

UIViewController에 <UIWebViewDelegate> 선언하고,

거기에 델레게이트 연결하니까 먹더라.


... 델레게이트 구현하는 곳이 뷰컨트롤러여야되나?...


Posted by tenn
,

[objc] UIWebView, cache

iPhone 2013. 5. 30. 18:46

NSURLRequest initWithURL:cachePolicy:timeoutInterval

cachePolicy: NSURLCacheStorageNotAllowed


하거나

[[NSURLCache sharedURLCacheremoveCachedResponseForRequest:targetRequest];


하면 된다고 하는데?

Posted by tenn
,

ISO 국가코드

etc 2013. 5. 30. 17:06



http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes



Posted by tenn
,

[objc] UILabel, line

iPhone 2013. 5. 30. 16:55

        label.numberOfLines = 3;

        label.lineBreakMode = UILineBreakModeWordWrap;

Posted by tenn
,

[objc] use Autolayout

iPhone 2013. 5. 30. 14:18



http://www.raywenderlich.com/ko/21139/ios-6%EC%97%90%EC%84%9C-%EC%98%A4%ED%86%A0-%EB%A0%88%EC%9D%B4%EC%95%84%EC%9B%83-%EC%8B%9C%EC%9E%91%ED%95%98%EA%B8%B0-%ED%8C%8C%ED%8A%B8-1-1

Posted by tenn
,