검색결과 리스트
IT분야/iOS에 해당되는 글 30건
- 2012.06.29 AFNetworking
- 2012.02.22 [iOS]한글 추가 폰트 사용하기
- 2012.02.22 [iOS]CATransction을 이용한 애니메이션 구현
- 2012.02.17 [iOS] Audio Streaming (2)
- 2012.02.08 [iOS] TBXML 파서로 XML 파싱하기
- 2012.02.08 [iOS] Background Pattern Image 적용
- 2012.02.08 [iOS] 인코딩 변경 (UTF-8)
- 2012.02.05 [iOS] iPhone, iPad 가로, 세로 고정
- 2012.02.05 [iOS] iOS App 개발용 Open Source 모음 (펌) (1)
- 2012.01.31 [iOS]UIWebView에서 user-agent 변경
글
기존에 HTTP 라이브러리를 ASIHTTPRequest를 사용했었습니다.
얼마전 iOS5에서 실행할려고 봤더니 아무리 해도 컴파일이 안됩니다.
구글링해보니 iOS5에서 안되며.. 얼마전 개발중단을 선언했다고 합니다.
급 라이브러리 변경.. AFNetworking를 사용해봤는데 괜찮습니다.
ASIHTTPRequest처럼 완전 간단하진 않지만 쓸만해보입니다.
JSON, XML 파싱된 데이터도 받을 수 있으며 이미지 lazyloading도 지원합니다.
https://github.com/AFNetworking/AFNetworking
http://stackoverflow.com/questions/7630289/afnetworking-post-request-with-json-feedback
'IT분야 > iOS' 카테고리의 다른 글
AFNetworking (0) | 2012.06.29 |
---|---|
[iOS]한글 추가 폰트 사용하기 (0) | 2012.02.22 |
[iOS]CATransction을 이용한 애니메이션 구현 (0) | 2012.02.22 |
[iOS] Audio Streaming (2) | 2012.02.17 |
[iOS] TBXML 파서로 XML 파싱하기 (0) | 2012.02.08 |
[iOS] Background Pattern Image 적용 (0) | 2012.02.08 |
설정
트랙백
댓글
글
한글체에 Bold를 적용할려고 보니 iOS 기본 글꼴체로는 되지 않았다.
한글 폰트를 추가로 등록하여 커스텀 폰트를 사용하면 적용이 된다.
1. 먼저 폰트를 추가하여야 한다. 본인은 인터넷에 있는 무료폰트인 헤움폰트를 이용해서 테스트해 보았습니다.
해당 파일을 XCode에 추가 시킨 후 plist 파일로 가서 아래처럼 추가시킨다.
2. 해당 글꼴의 이름을 알아야 합니다.
저는 해당 시스템의 글꼴을 검색해서 알아왔습니다.
for (NSString *familyName in [UIFont familyNames]) {
NSLog(@"%@ : [ %@ ]", familyName, [[UIFont fontNamesForFamilyName:familyName] description]);
}
3. self.labAddr.font = [UIFont fontWithName:@"HeummGothic172" size:16.0];
이런 형태로 사용하시면 됩니다.
'IT분야 > iOS' 카테고리의 다른 글
AFNetworking (0) | 2012.06.29 |
---|---|
[iOS]한글 추가 폰트 사용하기 (0) | 2012.02.22 |
[iOS]CATransction을 이용한 애니메이션 구현 (0) | 2012.02.22 |
[iOS] Audio Streaming (2) | 2012.02.17 |
[iOS] TBXML 파서로 XML 파싱하기 (0) | 2012.02.08 |
[iOS] Background Pattern Image 적용 (0) | 2012.02.08 |
설정
트랙백
댓글
글
출처 : http://www.prapps.net/514
//트랜잭션 시작
[CATransaction begin];
[CATransaction setValue:[NSNumber numberWithBool:YES] forKey:kCATransactionDisableActions];
[CATransaction setValue:[NSNumber numberWithFloat:0.5f] forKey:kCATransactionAnimationDuration]; //실행되는 시간
// Animation 설정
CATransition *push = [CATransition animation];
[push setType:kCATransitionMoveIn]; //Animation 타입
push.subtype = kCATransitionFromLeft; //Animation이 시작될 위치
//push.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
//애니메이션이 일어날 뷰의 레이어에 애니메이션을 추가 시킨다.
[self.imgMain.layer addAnimation:push forKey:kCATransition];
//이미지뷰에 이미지 변경
UIImage *tempImg = [[UIImage alloc] initWithData:data];
self.imgMain.image = tempImg;
[tempImg release];
//애니메이션 시작
* 애니메이션 타입
- kCATransitionFade
- kCATransitionMoveIn
- kCATransitionPush
- kCATransitionReveal
* 서브 타입
- kCATransitionFromRight
- kCATransitionFromLeft
- kCATransitionFromTop
- kCATransitionFromBottom
'IT분야 > iOS' 카테고리의 다른 글
AFNetworking (0) | 2012.06.29 |
---|---|
[iOS]한글 추가 폰트 사용하기 (0) | 2012.02.22 |
[iOS]CATransction을 이용한 애니메이션 구현 (0) | 2012.02.22 |
[iOS] Audio Streaming (2) | 2012.02.17 |
[iOS] TBXML 파서로 XML 파싱하기 (0) | 2012.02.08 |
[iOS] Background Pattern Image 적용 (0) | 2012.02.08 |
설정
트랙백
댓글
글
그래서 원격지에 있는 음악파일을 재생시에는 다운 받아서 재생을 해야겠지요..
스트리밍이 지원되는 라이브러리가 없을까 찾아보다가 아래와 같은 사이트 검색...
https://github.com/mattgallagher/AudioStreamer
라이브러리와 사용하는 샘플 예제가 같이 들어 있습니다. 어렵지 않게 사용하 실 수 있을 겁니다.
예제 속에는 슬라이더를 이용한 프로그레스 진행상황을 알 수있는 부분과 특정 위치 이동하는 기능등
필요한 부분은 다 구현되어 있습니다.
다만 한가지 스트리밍이 종료될 시점에 현재 재생시간을 알아오는 부분이 문제가 좀 있더군요..
음악은 처음 부터 끝까지 잘 재생되지만 마지막 부분에서 슬라이더가 이동되지 않아 사용자가 보기에
노래가 재생이 덜 된것 처럼 보입니다. 실제로는 다 재생된 겁니다.
해결 방법은 AudioStreamer.m 파일에서 소스를 약간 추가해 주었습니다.
if(sampleRate > 0 && ![self isFinishing]){
....
}else if([self isFinishing]){
별건 없습니다. 종료될 타임에는 현재 오디오 재생시간을 못가져오도록 막혀 있어서 추가해 줬습니다.
원본 소스에서 else if 구문을 추가해 주시면 됩니다.
더 좋은 방법이 있는지는 모르겠지만...
그럼 즐프..
'IT분야 > iOS' 카테고리의 다른 글
[iOS]한글 추가 폰트 사용하기 (0) | 2012.02.22 |
---|---|
[iOS]CATransction을 이용한 애니메이션 구현 (0) | 2012.02.22 |
[iOS] Audio Streaming (2) | 2012.02.17 |
[iOS] TBXML 파서로 XML 파싱하기 (0) | 2012.02.08 |
[iOS] Background Pattern Image 적용 (0) | 2012.02.08 |
[iOS] 인코딩 변경 (UTF-8) (0) | 2012.02.08 |
글
개발을 할 때에 http로 자료를 송수신할 때 JSON이나 XML을 많이 씁니다.
저는 JSON을 더 선호하긴 하지만 XML도 할 때가 많습니다.
iOS에 기본적으로 탑재되어 있는 NSXMLParser는 쓰기가 넘 힘들더군요..헷갈리기도 하고.
검색해보니 TBXML이란 놈이 있더군요.. 속도도 빠르고 메모리도 적게 먹습니다..
사용방법도 NSXMLParser보다 몇배는 더 간결..
1. 아래 사이트에서 라이브러리를 다운 받습니다. -- TBXML.zip
http://www.tbxml.co.uk/TBXML/Changes.html
2. 추가할 라이브러리
NSDataAdditions.h
NSDataAdditions.m
TBXML.h
TBXML.m
- frameworks에 libz.dylib 추가
3. 사용방법은
http://www.tbxml.co.uk/TBXML/API.html
API에 정말 한눈에 보이도록 잘 되어 있습니다.
API로는 부족하시다면 1번 사이트에서 TBXML-Books.zip 에 샘플 예제가 있습니다.
자바버전도 있으니 참고 하시길..
'IT분야 > iOS' 카테고리의 다른 글
[iOS]CATransction을 이용한 애니메이션 구현 (0) | 2012.02.22 |
---|---|
[iOS] Audio Streaming (2) | 2012.02.17 |
[iOS] TBXML 파서로 XML 파싱하기 (0) | 2012.02.08 |
[iOS] Background Pattern Image 적용 (0) | 2012.02.08 |
[iOS] 인코딩 변경 (UTF-8) (0) | 2012.02.08 |
[iOS] iPhone, iPad 가로, 세로 고정 (0) | 2012.02.05 |
설정
트랙백
댓글
글
self.view.backgroundColor = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"패턴이미지"]];
'IT분야 > iOS' 카테고리의 다른 글
[iOS] Audio Streaming (2) | 2012.02.17 |
---|---|
[iOS] TBXML 파서로 XML 파싱하기 (0) | 2012.02.08 |
[iOS] Background Pattern Image 적용 (0) | 2012.02.08 |
[iOS] 인코딩 변경 (UTF-8) (0) | 2012.02.08 |
[iOS] iPhone, iPad 가로, 세로 고정 (0) | 2012.02.05 |
[iOS] iOS App 개발용 Open Source 모음 (펌) (1) | 2012.02.05 |
설정
트랙백
댓글
글
출처 : http://www.cocoadev.co.kr/tag/RSS
HTTP 로 데이터를 전송 받을 때 한글이 깨어지는 경우가 있었다.
아래와 같이 넘어온 데이터의 인코딩을 변경 해 주면 된다
receiveData 는 HTTP 요청 후 받은 데이터(NSData)
NSString *str = [[NSString alloc] initWithData:receiveData encoding:0x80000000 + kCFStringEncodingDOSKorean];
NSData *data = [str dataUsingEncoding:NSUTF8StringEncoding];
다시 NSString으로 변경 해서 출력 해 보면 잘 나온다.
'IT분야 > iOS' 카테고리의 다른 글
[iOS] TBXML 파서로 XML 파싱하기 (0) | 2012.02.08 |
---|---|
[iOS] Background Pattern Image 적용 (0) | 2012.02.08 |
[iOS] 인코딩 변경 (UTF-8) (0) | 2012.02.08 |
[iOS] iPhone, iPad 가로, 세로 고정 (0) | 2012.02.05 |
[iOS] iOS App 개발용 Open Source 모음 (펌) (1) | 2012.02.05 |
[iOS]UIWebView에서 user-agent 변경 (0) | 2012.01.31 |
설정
트랙백
댓글
글
아이폰을 개발하다 보면 회전을 한다든지 세로 또는 가로 고정으로 해야 할 때가 있습니다.
아래 코드는 UIViewController 에서 모든 방향으로 회전이 가능한 코드입니다.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
return YES;
}
UIInterfaceOrientationPortrait
UIInterfaceOrientationPortraitUpsideDown
UIInterfaceOrientationLandscapeLeft
UIInterfaceOrientationLandscapeRight
return 값을 넘겨 줄때 해당 상황에 맞게 넘겨 주면 되겠지요
1. 세로 고정
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation ==UIInterfaceOrientationPortraitUpsideDown);
}
2. 가로 고정
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft|| interfaceOrientation ==UIInterfaceOrientationLandscapeRight);
}
'IT분야 > iOS' 카테고리의 다른 글
[iOS] Background Pattern Image 적용 (0) | 2012.02.08 |
---|---|
[iOS] 인코딩 변경 (UTF-8) (0) | 2012.02.08 |
[iOS] iPhone, iPad 가로, 세로 고정 (0) | 2012.02.05 |
[iOS] iOS App 개발용 Open Source 모음 (펌) (1) | 2012.02.05 |
[iOS]UIWebView에서 user-agent 변경 (0) | 2012.01.31 |
[iOS] UIScrollView를 이용한 Image Zoom in/out (0) | 2011.08.18 |
설정
트랙백
댓글
글
<csv 파서>
GDataXML :
http://code.google.com/p/gdata-objectivec-client/source/browse/trunk/Source/XMLSupport/ (소스)
http://www.raywenderlich.com/725/how-to-read-and-write-xml-documents-with-gdataxml (해설)
TBXML : (read only, XPath 미지원)
http://www.tbxml.co.uk/TBXML/TBXML_Free.html
TouchXML : (read only, XPath 지원)
https://github.com/TouchCode/TouchXML
- 다양한 UI 구현
- 테이블뷰셀 커스터마이징
- HTTP GET/POST 요청
- XML 파싱
- 사진 앨범, 카메라, 지도 이미지 접근
- 맵뷰 및 위치정보
- 푸시 노티피케이션
<google toolbox>
http://code.google.com/p/google-toolbox-for-mac/
<이미지 프로세싱>
http://code.google.com/p/simple-iphone-image-processing/
'IT분야 > iOS' 카테고리의 다른 글
[iOS] 인코딩 변경 (UTF-8) (0) | 2012.02.08 |
---|---|
[iOS] iPhone, iPad 가로, 세로 고정 (0) | 2012.02.05 |
[iOS] iOS App 개발용 Open Source 모음 (펌) (1) | 2012.02.05 |
[iOS]UIWebView에서 user-agent 변경 (0) | 2012.01.31 |
[iOS] UIScrollView를 이용한 Image Zoom in/out (0) | 2011.08.18 |
[iOS] App Update 할때 버전 문제 (0) | 2011.08.18 |
글
기존에 user-agent 변경하는 방법을 Swizzle을 이용해서 변경했었는데
iOS 5로 업데이트 되면서 변경이 안되었다. 물론 앱스토어에 올라가 있는 앱들이 제대로 되지도 않고..
그래서 찾아보다가 한참을 헤매었는데 위 블로그에서 아래와 같은 방법을 찾았다.
AppDelegate.m 파일에 아래 코드를 넣으면 됩니다.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
NSString *deviceModel = [[UIDevice currentDevice].model stringByReplacingOccurrencesOfString:@"" withString:@""];
NSString *userAgent = [NSString stringWithFormat:@"Mozilla/5.0 (%@; CPU OS 5_0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Mobile/9A334,webView_iphone",deviceModel];
NSDictionary *dictionnary = [[NSDictionary alloc] initWithObjectsAndKeys:userAgent,@"UserAgent", nil];
[[NSUserDefaults standardUserDefaults] registerDefaults:dictionnary];
[dictionnary release];
.....
.....
}
본인은 스마트폰에서 모바일웹으로 접속한 것인지 앱에서 웹뷰로 접속한 것인지 구분하기 위해
UserAgent 맨 뒤에 ,webView_iphone 문자열을 삽입하였습니다.
확인은 웹뷰를 구현한 곳에서 아래처럼 출력하시면 확인 할 수 있습니다
-(BOOL) webView:(UIWebView*) webView shouldStartLoadWithRequest:(NSURLRequest*) req navigationType:(UIWebViewNavigationType) navigationType{
NSMutableURLRequest *request = (NSMutableURLRequest *)req;
NSLog(@"%@",[request allHTTPHeaderFields]);
....
....
}
'IT분야 > iOS' 카테고리의 다른 글
[iOS] iPhone, iPad 가로, 세로 고정 (0) | 2012.02.05 |
---|---|
[iOS] iOS App 개발용 Open Source 모음 (펌) (1) | 2012.02.05 |
[iOS]UIWebView에서 user-agent 변경 (0) | 2012.01.31 |
[iOS] UIScrollView를 이용한 Image Zoom in/out (0) | 2011.08.18 |
[iOS] App Update 할때 버전 문제 (0) | 2011.08.18 |
[iOS] iPhone용 OpenSource 모음 - 펌 (0) | 2011.07.27 |