为什么';我与libactivator集成的代码在iOS5.x中不能工作吗?
我将使用libactivator在我的应用程序中创建控制机制。但它在iOS5.x中不工作,而在iOS6.x中工作良好。在我的测试代码中,它将在接收事件时弹出提示警报(默认情况下为libactivator.volume.up.press)。这在iOS6.x中有效,但在iOS5.x中无效。在Activator的设置视图中,没有任何错误,只是没有效果,也没有此应用程序的设置选项为什么';我与libactivator集成的代码在iOS5.x中不能工作吗?,ios,objective-c,jailbreak,tweak,Ios,Objective C,Jailbreak,Tweak,我将使用libactivator在我的应用程序中创建控制机制。但它在iOS5.x中不工作,而在iOS6.x中工作良好。在我的测试代码中,它将在接收事件时弹出提示警报(默认情况下为libactivator.volume.up.press)。这在iOS6.x中有效,但在iOS5.x中无效。在Activator的设置视图中,没有任何错误,只是没有效果,也没有此应用程序的设置选项 #import <Foundation/Foundation.h> #import <UIKit/UIKi
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <libactivator/libactivator.h>
@interface TestActivator : NSObject<LAListener> {
}
@end
@implementation TestActivator
- (void)activator:(LAActivator *)activator receiveEvent:(LAEvent *)event
{
UIAlertView *av = [[UIAlertView alloc] initWithTitle:@"TestActivator" message:[event name] delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil];
[av show];
[av release];
[event setHandled:YES];
}
+ (void)load
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSString * packID = @"com.example.TestActivator";
[[LAActivator sharedInstance] registerListener:[self new] forName:packID];
[[LAActivator sharedInstance] assignEvent:[LAEvent eventWithName:@"libactivator.volume.up.press"] toListenerWithName:packID];
[pool release];
}
@end
#导入
#进口
#进口
@接口测试激活器:NSObject{
}
@结束
@实现测试激活器
-(无效)激活器:(LAActivator*)激活器接收事件:(LAEvent*)事件
{
UIAlertView*av=[[UIAlertView alloc]initWithTitle:@“TestActivator”消息:[事件名称]委托:nil cancelButtonTitle:@“确定”其他ButtonTitles:nil];
[视听节目];
[视听释放];
[事件集处理:是];
}
+(空)荷载
{
NSAutoreleasePool*池=[[NSAutoreleasePool alloc]init];
NSString*packID=@“com.example.TestActivator”;
[[LAActivator sharedInstance]注册者列表器:[自我更新]forName:packID];
[[LAActivator sharedInstance]assignEvent:[LAEvent eventWithName:@“libactivator.volume.up.press”]按“]到ListenerWithName:packID];
[池释放];
}
@结束