2011-07-10 25 views
0

私は最近.dylibを作ってしまい、うまくいきません。私はいくつかのことが間違っていたと言われていて、私は欠けているものを失いますあなたが私に何が足りないのか教えてください。mobilesubstrateの調整で助けが必要

 
#import <CoreFoundation/CoreFoundation.h> 
#import <Foundation/Foundation.h> 
#import <UIKit/UIKit.h> 
#import "libactivator.h" 
#include <stdio.h> 
#include <dlfcn.h> 
#include <unistd.h> 

@interface ASListener : NSObject<LAListener, UITextViewDelegate, UIAlertViewDelegate> { 

@private 

        UIAlertView *av; 
        UITextView *scriptField; 
} 

@end 



@implementation ASListener 


- (void)dismiss 
{ 
        if (av) { 
                [av dismissWithClickedButtonIndex:[av cancelButtonIndex] animated:YES]; 
                [av release]; 
                av = nil; 
        } 
} 

- (void)activator:(LAActivator *) receiveEvent:(LAEvent *)event 
{ 

        [self dismiss]; 

        av = [[UIAlertView alloc] initWithTitle:@"AlertScript" message:@" " delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Exec", nil]; 

[av show]; 
[av release]; 

scriptField = [[UITextView alloc] initWithFrame: CGRectMake(10, 10, 255, 151)]; 

[av addSubview:scriptField]; 

if(scriptField) { 
        scriptField.delegate = self; 
        scriptField.editable = YES; 
} 
NSString *script = scriptField.text; 

[script writeToFile:@"/usr/bin/AlertScript"  
atomically:YES encoding:NSUnicodeStringEncoding error:nil]; 

        [UITextView release]; 

} 


- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex 
{ 

  if (buttonIndex == 0) 

  { 

    NSLog(@"exec"); 
    system("AlertScript"); 
    system("AlertScriptReset"); 

  } 
  else 
  { 
    NSLog(@"cancel"); 
  } 
} 

- (void)activator:(LAActivator *)activator abortEvent:(LAEvent *)event 
{ 
        [self dismiss]; 
} 

+ (void)load 
{ 
         
[[LAActivator sharedInstance] registerListener:[self new] forName:@"com.fhsjaagshs.alertscript"]; 
} 
@end 

答えて

0

あなたが一般的にコードの特定の部分が間違っているものをいっぱいに説明するコンパイラの出力、なしで不足している何を伝えるために、文字通り不可能です。 コンパイラのコマンドラインで "-lactivator"を使用してlibactivatorにリンクしていますか? UIKitとFoundationについてはどうですか?

私たちは霊的ではありません。実際にエラーメッセージを出すことができるコンパイラよりも、もっと簡潔に何が欠落しているかは分かりません。

0

私は - (void)アクティベーターの名前を間違っていることがわかりました イベントを受信しました。また、コードは非常に早いバージョンであり、現在はかなりうまく機能しています。

http://www.github.com/fhsjaagshs/