iOS5 에선 수정되었음. 단, iOS4 와의 호환성을 위해서라면 여전히 유효한....
PreferenceLoader 자체가 설정을 "로드" 해주는게 다라서 PL 버젼 보다는 iOS 버젼을 따라가는듯...


======
당췌 PreferenceBundles 부분은 관련 문서를 구할 수가 없다..
게다가 open source 인데 소스가 git 에서 사라진 상태;;(검색해도 안나오고 말이쥐;;)
(수정.. 소스가 있긴 있다. 근데 이제보니 별로 도움안되는 소스더라..)

이런 상황에서 용케 만드는 사람들이 신기하군..ㅠㅠ


하여간,
PSViewController 에서 다음 뷰로 넘기기 위해선
PushViewController:animated:  가 아니라 PushController: 를 사용하면 되는데
문제는 PSViewController 클래스만 지원한다..

아니, UIViewController 도 되긴 되는데 UIViewController 로 넘어간 후에 뒤로가기를 누르면 튕겨버린다.
이유는 뒤로가면서 원래 보던 뷰에 setRootController:(id)controller 라는 메소드를 호출하는데
UIViewController 에는 해당 메소드가 없다..ㅠ

PreferenceBundles 에서 사용되는 클래스들은 일반적으로 쓰는 클래스를 하나도 상속 받지 않더라..ㅠ
(뭐 NSObject 정도는 상속 받겠지만)

게다가 PSViewController 에는 addSubView: 같은 메서드도 없다! 이런...


방법은
1. PSViewController 에서 -(id)view 를 재정의 한다.
 즉 -(id)view 메소드에서 내가 쓰려는 뷰나 뷰컨트롤러를 만들고 그 뷰를 return 해주면 된다.

하지만 나의 경우엔 LibActivator 의 EventSettingView 를 가져오는데 저렇게 하니 깨짐;;ㅠㅠ

그래서 곰곰히 생각해보다가 해결!!

2. UIViewController 에서 setRootController: 정의 하면 된다 ㅋ
원랜 Preference 소스 보고 원래대로 작동하게 할려고 했는데 소스도 없고 테스트 해보니 걍 아무 작업 안해줘도 잘만 되더라.


@interface newView : UIViewController
- (void)setRootController:(id)controller;
@end

@implementation newView
- (void)setRootController:(id)controller
{
return;
}
@end


그리고 newView 를 호출해서 pushController 해주면 끗~!

iOS 버젼따라 오류가 날 수도 있다. 그러면 그 메소드들을 다시 오버라이드 해주자.
나의 경우 iOS4, 5 에서 전혀 문제 없었다.


뭐 간단한 몇몇 가지는 libactivator.h 를 import 하는 것으로 사용이 가능하지만(뭐 THEOS 에 들어있는 헤더는 몇가지가 빠진거라서 제대로 쓰려면 Activator 오픈소스에서 가져와야 한다)

libactivator.dylib 을 링크 해줘야만 작동되는 기능들도 있다. 

애초에 XCode 쓸때도 플래그는 잘 모른다고 무시하고  다른 프레임워크 처럼 Link Binary 만 해줘도 잘 됬었는데
THEOS 에서는 어떻게 해야할지 모르겠더라;;ㅠㅠㅠ


해결법은
$THEOS/lib/ 에 libactivator.dylib 을 복사해 넣은 뒤

Makefile 에
[BUNDLE NAME]_LDFLAGS = -lactivator 
를 추가해주면 된다. 
I can easily find a way for adding actions in activator.
( http://iphonedevwiki.net/index.php/Libactivator

This is the way to add event (like shake device..) for activator on iDevice.

First, You need libactivator.h
If you installed THEOS, you can find this. But that does not have interface for adding event.
So you need get libactivator.h from Ryan Petrich's github(Click Here).

Next, Add these code on your project.

Click ↓ (From source of libactivator - Link ) 
Then, when you call init, you event is added to activator.
I called init from Mobile Substrate Extension(.dylib) like this

Click ↓



You can called your event like this.
Click ↓(From source of libactivator - Link )



Thank you for reading my terrible English..TT

If you cannot understand this, you can find a lot of information here

https://github.com/rpetrich/libactivator  :  source of libactivator
 - LADefaultEventDataSource.m
: Add Event
 - Events.m
: Call Event
 - libactivator-private.h
: Interface of aboves

 - libactivator.h
 - libactivator.m



아.. 누구 저의 X같은 영어 교정해주실 천사 같으신 분 없을까요..?ㅠ 

+ Recent posts