编译第一个Tweak又报错,大侠请进!

bogon:iosgreeting jimmy$ make package install
Making all for tweak IOSGreeting...
 Preprocessing Tweak.xm...
 Compiling Tweak.xm...
Tweak.xm:7:63: error: non-ASCII characters are not allowed outside of literals
      and identifiers
    UIAlertView *alert = [ [UIAlertView alloc] initWithTitle:@“Hello lov...
                                                              ^
Tweak.xm:7:62: error: unexpected '@' in program
    UIAlertView *alert = [ [UIAlertView alloc] initWithTitle:@“Hello lov...
                                                             ^
Tweak.xm:7:77: error: non-ASCII characters are not allowed outside of literals
      and identifiers
  ...*alert = [ [UIAlertView alloc] initWithTitle:@“Hello lover” message:nil ...
                                                               ^
Tweak.xm:7:112: error: non-ASCII characters are not allowed outside of literals
      and identifiers
  ...initWithTitle:@“Hello lover” message:nil cancelButtonTitle:@“OK” otherBu...
                                                                 ^
Tweak.xm:7:117: error: non-ASCII characters are not allowed outside of literals
      and identifiers
  ...initWithTitle:@“Hello lover” message:nil cancelButtonTitle:@“OK” otherBu...
                                                                    ^
5 errors generated.
make[2]: *** [obj/Tweak.xm.b25cbfcd.o] Error 1
make[1]: *** [internal-library-all_] Error 2
make: *** [IOSGreeting.all.tweak.variables] Error 2

完全照书上敲进去的,网上查了一下,说是使用了中文字符,我的Mac都没装输入法,我甚至不知道如何敲中文。

我也不想麻烦大家,但是每一步都有问题,对于我这个新手来说也是累啊,只能继续求助各位。谢谢了!

是了,你们老说用Google查询,需要翻墙吧? 你们都用哪些翻墙软件?

我的Tweak.xm的内容如下:

%hook SpringBoard

- (void) applicationDidFinishLaunching:(id)application
{
    %orig;

    UIAlertView *alert = [ [UIAlertView alloc] initWithTitle:@“Hello lover” message:nil cancelButtonTitle:@“OK” otherButtonTitles:nil];
    [alert show];
    [alert release]; 
}

%end

你用的是全角的双引号

###建议你先花2个月的时间学习正向开发,目前阶段,你自我解决问题的能力不足以应付逆向工程

我就喜欢别人刺激我,谢谢你的鼓励! :grinning:

还是想问你,我的Mac没有装中文输入法,只有美国输入法,还有全角半角之分?

如果要解惑,请勿答非所问,并不是每个人象你那样,学了几年苹果。

可能是我的键盘问题或者说是虚拟机的问题,的确打了全角的符号,这次符号正确了,确又出新问题,我建议作者如果有第三版,应该弄一张光盘,里面有所有例子的源代码,或者提供网上下载,否则时间都弄到去排错了,啥时候能看完你这本书啊。

错误如下:

bogon:iosgreeting jimmy$ make 
Making all for tweak IOSGreeting...
 Preprocessing Tweak.xm...
 Compiling Tweak.xm...
Tweak.xm:7:48: error: instance method
      '-initWithTitle:message:cancelButtonTitle:otherButtonTitles:' not found
      (return type defaults to 'id') [-Werror,-Wobjc-method-access]
  ...initWithTitle:@"Hello lover" message:nil cancelButtonTitle:@"OK" otherButtonTitles...
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode-beta.app/Contents/Developer//Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAlertView.h:26:12: note: 
      receiver is instance of class declared here
@interface UIAlertView : UIView
           ^
1 error generated.
make[2]: *** [obj/Tweak.xm.b25cbfcd.o] Error 1
make[1]: *** [internal-library-all_] Error 2
make: *** [IOSGreeting.all.tweak.variables] Error 2

相信你是一个负责人的人,你会帮我的,谢谢!

如果要问问题,请提前做些功课,这个论坛的门槛较高,并不是每个人都像我一样,对随便google就可以查到答案的问题有这么多耐心。
本书面向的群体是:

iOS狂热爱好者。
中高级iOS开发人员。他们在掌握了App开发之后对iOS有更深的渴求。
架构师。在逆向App的整个过程中,架构师能学习那些优秀App的架构设计,以这种方式博采众长,提高自己的架构设计能力。
在别的系统上从事逆向工程,想要转向iOS逆向工程的工程师。

就你现在的水平而言,建议先去买本唐巧的《iOS进阶》,入门再说

那你出这本书干嘛?最简单的HelloWorld,都无法愉快的编译通过,你觉得自己没责任吗?我87年开始接触计算机,当时用的是Apple II,我04年开始学逆向,不要以为自己有多厉害。只是我想善意提醒你,你出书,就是要普罗大众。我不知道他们是不是轻松就能编译通过你的HelloWorld。至少Windows下,无论哪种语言,还不至于半天都弄不成功的。你不愿意帮我,我大不了不问。

期待你的第三版能写得更清楚,更好!

连最基本的开发基础都没有就学逆向, 还这么虚心, 现在的人真厉害

:mask:

论坛不应该是拿来冷嘲热讽的,既然觉得论坛开来不是为新手服务的,那我以后不会再问问题。

向别人请教 低级 问题,姿态还摆这么高,这臭毛病是跟谁学的?
没人教你是吧,今天我就来教你做人:
87年接触计算机,有小30年了,到头来,全半角都分不清?
04年学逆向,有10年了,权限不懂,函数名也拼不对?
低级问题不会google,甚至不会百度?
除了这个回帖,我哪个帖子里的哪个字冷嘲热讽你了?
30年的经验,学习水平和解决问题的能力几乎为0,觉得很光荣?
当伸手党还当出优越感来了,是么?谁给你惯的?
不以为耻,反以为荣?拿无知当个性?

你是论坛开坛以来我第一个想封禁的人,此帖保留,以示后人,我们论坛不欢迎这样的老流氓!

8 个赞

我就挖个坟。我知道你能收到邮件。
编译不了HW不是书的问题,是你的智商问题

1 个赞

我有个问题就是不能识别控件的类型,我也导入UIKit 还有其他地方需要注意吗

单独开贴提问吧,带上报错的日志