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 프리지크
:

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 프리지크
:

아시는 분은 아시겠지만, 지난 밤 애플이 시장을 들썩이게 만드는 또 하나의 서비스를 내 놨습니다.
iBooks Author 와 iTunes U 입니다.

이전까지는 iPad에서 볼 수 있는 iBooks용 컨텐츠를 개별적인 툴로 만들거나 pdf 등을 올려서
이용했었는데, 애플에서 iBooks를 만들 수 있는 저작툴을 배포했네요. 그것도 무료로.
(머..맥을 가지고 있어야 한다는 전제가 있어서 무료라고 하긴 조금 그렇습니다만. ㅎㅎ
 잠깐 써 보니 파워포인터나 키노트를 만져본 분이면 누구나 쉽게 접근 할 있을 듯해요.)

교육 시장을 목표로 만들었다고는 합니다만, 지난 회사에서 패드용 매거진류를 만들어본 제 입장에서는
일반 매거진부터 개인저작자들까지 많은 영향을 받을 것 같습니다. 시장이 들썩들썩 거리는 듯해요.
관심없는 분도 계시겠지만, 저작물을 내 놓든 개인 발전을 위해 공부를 하든...어쨌든 도움이 되는
서비스가 나왔다라는 것 정도만 아셔도 좋을 듯. ^^

- 관련 동영상
 : www.viddler.com/embed/5e4ed948/?f=1&offset=0&autoplay=0&disablebranding=0

- 관련 내용
 : http://news.naver.com/main/hotissue/read.nhn?mid=hot&sid1=105&cid=303949&iid=26517648&oid=092&aid=0001993871&ptype=011
 : http://blog.naver.com/newglare/140150145465

Posted by 프리지크
:

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

공지사항

카테고리

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

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백

Total :
Today : Yesterday :