1) 구글
   - https://developers.google.com/android/c2dm/?hl=ko-KR
       ; 구글 공식 사이트

 2) 일반 사이트
   - http://pizzastudio.tistory.com/entry/%EC%95%88%EB%93%9C%EB%A1%9C%EC%9D%B4%EB%93%9C-C2DM-%EB%A9%94%EC%8B%9C%EC%A7%80-%EC%A0%84%EC%86%A1-%EB%B0%A9%EB%B2%95
     ; 위의 구글 사이트에서 C2DM 부분 간략 번역.
   - http://warmz.tistory.com/570
     ; 서버를 거치치 않고 디바이스->디바이스로 전달하는 예제 소스 제공.
   - http://blog.daum.net/servermanager/28
     ; 개념도와 함께 잘 간략히 설명.
   - http://www.androidside.com/bbs/board.php?bo_table=B46&wr_id=14705

 3) 오픈 소스
     - https://github.com/Redth/C2DM-Sharp
       ; C#으로 구현한 오픈소스. 서버용, 클라이언트용으로 샘플도 제공.
     - http://www.codeproject.com/Articles/339162/Android-push-notification-implementation-using-ASP
       ; C# 예제 소스 제공.

Posted by 프리지크
:

1) Apple Developer Site
     - https://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Introduction/Introduction.html
     -https://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/ApplePushService/ApplePushService.html#//apple_ref/doc/uid/TP40008194-CH100-SW9
       ; 애플 개발자 사이트의 APNS Guide 문서.

  2) 일반 사이트
     - http://www.appsmaker.co.kr/community/knowhow_read.php?start=0&id=88&tx_search_os=1&tx_search_field=1&tx_search_string=
       ; 위 APNS Guide 문서를 간략하게 번역해 놓은 곳.
     - http://arashnorouzi.wordpress.com/2011/03/31/sending-apple-push-notifications-in-asp-net-part-1/
       ; asp.net and C# source 제공.
     - http://theeye.pe.kr/entry/iPhone-Push-NotificationAPNS%EB%A5%BC-PHP%EC%97%90%EC%84%9C-%EB%B3%B4%EB%82%B4%EB%8A%94-%EB%B0%A9%EB%B2%95
       ; 간략 예제 소스 제공.

 3) 오픈소스
   - https://github.com/Redth/APNS-Sharp
     ; C#으로 구현한 오픈소스. 보내기, 피드백 받기, 오류 처리 등의 기능을 넣은 클래스 제공.

  - http://code.google.com/p/apns-php/

  - http://www.easyapns.com/


Posted by 프리지크
:

하이브리드 앱에 대해서 알아 보던 중에 각 프레임워크별로 잘 정리된 슬라이드가 있어서 링크~

URL : http://www.slideshare.net/w3labs/ss-9014657


크로스플랫폼 앱 프레임워크 선택의 기준

by 미래웹기술연구소 (W3LABs) on Aug 25, 2011


Posted by 프리지크
:

dataUsingEncoding의 속성을 아래와 같이 주면 된다.

NSData *stringData = [textField.text dataUsingEncoding:0x80000000+kCFStringEncodingDOSKorean];

NSLog(@" %d", [stringData length]);
 
한글은 2자씩, 영문은 1자씩 계산해서 length 를 뱉어낸다.
Posted by 프리지크
:

UITabBarController를 이용하다 보면 앱 실행 시 첫번째 탭바 말고 중간이나 다른 탭바가 먼저 화면에
노출되어야 하는 경우가 있다.

탭바 속성 중에

self.tabBarController.selectedIndex = 3;

로 설정해 줄 수 있는데, 화면은 나타나지 않는 경우가 있다.

이 때, 아래 메소드를 이용해주면 된다.

[self.tabBarController.selectedViewController viewDidAppear:YES];
Posted by 프리지크
:

    <items>
        <item id=”0001″ type=”donut”>
            <name>Cake</name>
            <ppu>0.55</ppu>
            <batters>
                <batter id=”1001″>Regular</batter>
                <batter id=”1002″>Chocolate</batter>
                <batter id=”1003″>Blueberry</batter>
            </batters>
            <topping id=”5001″>None</topping>
            <topping id=”5002″>Glazed</topping>
            <topping id=”5005″>Sugar</topping>
        </item>
    </items>

위와 같은 XML 을 NSXMLParser로 파싱하다 보면 (void)parser:foundCharacters 에서 '<'앞의
공백도 함께 넣어버림으로써 "         Cake" 따위가 만들어진다.
이 때 아래와 같이 제거 메소드를 사용하면 됨.

- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string
{
    [text appendString:[string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]];
}
Posted by 프리지크
:

일단 해결책을 구할 수 있었던 곳의 url 링크를 먼저.
 참조 : http://firekokoma.tistory.com/151

UILabel 등에 텍스트를 동적으로 입력을 할 때 크기를 바꿔줘야하는 경우가 생깁니다.
동적으로 크기를 구하기 위해서 많이들 사용하시는게 아래 메소드입니다.

 - sizeWithFont:constrainedToSize:lineBreakMode:

 예를 들자면,
CFSize size = [ViewContents.text sizeWithFont:[UIFont boldSystemFontOfSize:15.0]
                                  constrainedToSize:CGSizeMake(250, 5000) lineBreakMode:UILineBreakModeWordWrap]
이렇게들 쓰지요.

xCode 4.2 에서 이 메소드를 쓰고 있었는데, distribution 이나 release 로 컴파일해서 넣으면
size.height, size.width가 제대로 안나오는 경우가 있더군요.
이런 현상이 발생 안할 수도 있습니다.
일단 해결책은 아래와 같이 Build settings에서 Ohter C Flags에 -mno-thumb 를 추가해주고 해결하였습니다. LLVM Compiler의 최적화 관련 문제로 예상한다는데...그 이상은...ㅎㅎ



==> 젠장...xCode 4.3에서는 이런 현상 발생 안함. ;;;
Posted by 프리지크
:
 UIView 객체가 생성될 때 뷰들이 준비(viewDidLoad)되고 난뒤 그려줄 때 DrawRect가 불려진다.
화면에 그려주고 싶은게 있으면 보통 DrawRect에서 그려주는데, setNeedsDisplay로 DrawRect가 다시 불릴 수 있도록 이벤트를 던질 수 있다.
다만, Event Driven형식으로 동작하는 iOS에서는 setNeedsDisplay를 사용하면 즉시 drawRect가 동작되지 않는다. 이 녀석은 다시 그려야 할 것이 있다는 Flag만 설정 해 주고, 다음 실행 루프에서 drawRect가 동작하게 된다.

* setNeedsDisplay
Marks the receiver’s entire bounds rectangle as needing to be redrawn.
Discussion
You can use this method or the setNeedsDisplayInRect: to notify the system that your view’s contents need to be redrawn. This method makes a note of the request and returns immediately. The view is not actually redrawn until the next drawing cycle, at which point all invalidated views are updated.
  출처 : Apple Document.

* setNeedsDisplay:
Controls whether the receiver's entire bounds rectangle is marked as needing display.
- (void)setNeedsDisplay
Description
By default, geometry changes to a view automatically redisplays the view without needing to invoke the drawRect: method. Therefore, you need to request that a view redraw only when the data or state used for drawing a view changes. In this case, send the view the setNeedsDisplay message. Any UIView objects marked as needing display are automatically redisplayed when the application returns to the run loop.
  출처 :
http://www.picksourcecode.com/ps/ct/16683.php
Posted by 프리지크
:
    NSString *tt2 = [[NSString alloc] initWithString:@"tt2"];
    NSLog(@"tt2 retain count : %d", [tt2 retainCount]);
    [tt2 release];
    NSLog(@"tt2 retain count : %d", [tt2 retainCount]);

코딩 질을 하길 위 처럼 하면 예상되는 로그는
1
0
일겁니다. 그런데, 경악스럽게도
2147483647
2147483647
가 나옵니다.


그 이유가 개발자 문서 retainCount 메소드 부분에 나와있네요.

NSObject - retainCount

 For objects that never get released (that is, their release method does nothing), this method should return UINT_MAX, as defined in <limits.h>.

즉, 해제되지 말아야할 객체는 UINT_MAX를 리턴해준다는 군요.

@"tt2" 형태의 상수형 스트링을 넣게 되면  상수메모리에 잡히게 됨으로 release를 할 수 없게 된다는군요. 의외입니다.  여튼, 그래서 UINIT_MAX가 리턴된다는것!
Posted by 프리지크
:
Lion에서는 사용자 폴더 밑에 '라이브러리' 폴더가  히든 상태임.
이전 버전까지는 '라이브러리'가 잘 보여서 iphone simulator 폴더에 쉽게 접근이 가능했음.

히든 풀어주는 명령을 터미널에서 넣으면 됩.

chflags nohidden ~/Library

참고로 일반적인 iPhone simulator 경로 :
/Users/ 사용자명 /Library/Application Support/iPhone Simulator/4.3/Applications/ App의 GUID /Documents
Posted by 프리지크
:

BLOG main image
인생에서는 찾고, 노력하고, 희생할 각오가 되어 있는 것만 얻을 수 있다. (조시 매슈 애덤스) by 프리지크

공지사항

카테고리

분류 전체보기 (121)
끄적끄적 (16)
좋은 글 (9)
자료 (19)
런닝&피트니스 (18)
기술 (43)
기사 스크랩 (1)
내가 본 공연 후기 (1)
내가 가 본 맛집 (5)
괜찮아 보이는 펜션들 (4)
(4)
한장한장 (0)
비공개 스크랩 (0)

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백

Total :
Today : Yesterday :