Lomohome.com :: 괴발자 모근원


이번에도 또 애플과의 싸움에서 졌습니다. EventList 에 이어서 UIReferenceLibrary 를 이용한 InDic 또한 앱스토어에서 내려갔습니다.

InDic 에대한 자세한 설명은 이곳으로

이번 어플은 특히 라이센스와의 싸움이었는데요, 소스를 가지고 컴파일하셔서 가지고 다니시거나 수정하여 쓰시는건 문제가 없지만, 앱스토어에 등록하지는 마세요. Enfour, Oxford, Apple 등과 국제 소송에 휘말릴수 있습니다;;


개인적으로는 앱 개발시에 라이센스와 API Document 의 중요성을 인지할수있도록 도와준 앱이었습니다.


먼저, UIReferenceLibrary 의 Document 를 보시면..

https://developer.apple.com/library/ios/documentation/uikit/reference/UIReferenceLibraryViewControllerClassRef/Reference/Reference.html


It should not be used to display wordlists, create a standalone dictionary app, or republish the content in any form.

이라고 써있습니다.


요 API를 이용해서 홀로동작하는 사전어플을 만들면 안되는데, 만들었다 걸려서 내려갔네요.

미리 API문서를 꼼꼼히 확인못한 제 잘못이었습니다.


프로젝트안에는 텍스트파일처리, 인앱, 광고, TTS, 사전API, 등을 쓰는 예제들이 있으니 공부하시거나 현재 진행중인 프로젝트에 참고하실수 있을것 같네요.


많이들 받아가시고 받아가시면 리플 하나씩 부탁드려요~

즐거운 프로그래밍 되셔요~




소스 다운받기 ->

InDic.zip



* 소스보시고 욕하지 마시고;;; 소스엔 매우많은 버그와 허접함이 숨어있을수있습니다.

* 소스의 수정/재배포는 허용하지 않습니다. 

블로그의 링크를 걸어주세요.

Posted by 모근원
iPhone 어플에서 UIWebView 를 사용한 프로그램에서
웹뷰안에서 JavaScript 의 Alert 를 호출 하면  (ex -> javascript:alert("test some strings.");)
다음과 같이 호스트 이름이 얼럿창의 상단에 찍히게 된다.

보안때문에 상단의 ip 는 지웠지만 만약 웹뷰에서 lomohome.com  에서 얼럿창을 띄웠다면  lomohome.com 이라는 문구가 얼럿창의 타이틀에 뜨게 된다.

이 얼럿창은 UIWebView 에 카테고리를 이용하여 딜리게이트 메소드를 구현해주면 수정할 수 있다.
먼저 UIWebView 의 헤더파일에 다음과 같은 인터페이스를 추가해준다.

//@Geunwon,Mo 2010.9.17 : UIWebView Javascript alert 위한 카테고리.

@interface UIWebView (JavaScriptAlert) 

- (void)webView:(UIWebView *)sender runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame;

@end


그리고 구현파일에 구현해준다.
 

//@Geunwon,Mo 2010.9.17 : UIWebView Javascript alert 위한 카테고리.

@implementation UIWebView (JavaScriptAlert)

- (void)webView:(UIWebView *)sender runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame {

NSLog(@"javascript alert : %@",message);

    UIAlertView* customAlert = [[UIAlertView alloc] initWithTitle:@"Hana Bank" message:message delegate:nil cancelButtonTitle:@"확인" otherButtonTitles:nil];

    [customAlert show];

    [customAlert autorelease];

}

@end


 요렇게 구현하고 나면 다음과 같이 Title  에 원하는 문구로 자바스크립트 얼럿을 띄울 수 있다.



구현 메소드 중, 타이틀 인자를 nil 로 넣으면 아무것도 안찍힌다.

UIAlertView* customAlert = [[UIAlertView alloc] initWithTitle:nil message:message delegate:nil cancelButtonTitle:@"확인" otherButtonTitles:nil];




Posted by 모근원