iphone iOS4 破解应用程序
我有一个应用程序,自一年多前推出以来一直运行良好。
我最初使用 iPhone iOS 2.2.1 开发它,并进行了测试并一直销售到 3.2,没有出现任何问题。
现在iOS4无法启动。
该应用程序对 UIPickerView 使用非标准尺寸(我不认为这是问题,但只需提及它,因为您会在控制台输出中看到一些抱怨)。它还给出了以前未报告的 NSAutoreleasePool 警告。
但罪魁祸首似乎是在调整界面大小以适应新的 iPhone 屏幕分辨率时(至少是我从控制台获得的)
我知道我必须自己做一些研究,但 iOS4 已经发布了这么少,我一直非常专注于学习和开发我的第一个 Android 应用程序(所以我还没有测试这个特定的代码,一年后+这个应用程序每天只卖几份),我认为在这里询问一下是否有人有一些没有什么害处信息或已经遇到过。
首先,这是使用 XCODE 3.2.3 和 BASE SDK 3.2 构建和运行时的控制台输出,运行没有问题
2010-06-22 23:25:55.619 Metalsandmaterials[82956:207] ****** 辅助功能状态已更改:开启 2010-06-22 23:25:55.710 Metalsandmaterials[82956:207] ********** 加载 AX:xxxxxxxxx
但尝试使用 iOS4 运行它会带来这样的美感:
2010-06-22 23:15:52.488 Metalsandmaterials[80149:207] ****** 辅助功能状态已更改:开启
2010-06-22 23:15:52.546 金属和材料[80149:207] ********** 正在加载 AX: XXXXXXX ************
2010-06-22 23:15:53.003 Metalsandmaterials[80149:207] * -[NSAutoreleasePool release]:该池已被释放,请勿耗尽(双重释放)。
2010-06-22 23:15:53.005 Metalsandmaterials[80149:207] * -[NSAutoreleasePool release]:该池已被释放,请勿耗尽(双重释放)。
2010-06-22 23:15:53.008 Metalsandmaterials[80149:207] -[UIPickerView setFrame:]:无效高度值 50.0 固定到 162.0
就在这里! [UIIageView比例]
2010-06-22 23:15:53.011 Metalsandmaterials[80149:207] -[UIImageView 比例]:无法识别的选择器发送到实例 0x5ac47a0
2010-06-22 23:15:53.013 Metalsandmaterials[80149:207] *** 由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:“-[UIImageView 比例]:无法识别的选择器发送到实例 0x5ac47a0” < /p>第一次抛出时的调用堆栈:
(
0 CoreFoundation 0x025f5919 异常预处理 + 185
1 libobjc.A.dylib 0x027435de objc_exception_throw + 47
2 CoreFoundation 0x025f742b -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 核心基础 0x02567116 ___forwarding_ + 966
4 核心基础 0x02566cd2 _CF_forwarding_prep_0 + 50
5 UIKit 0x0039a8e3 -[UIImageView setImage:] + 250
6 UIKit 0x0039b63e -[UIImageView initWithImage:] + 161
7 UIKit 0x05f286ce -[UIImageViewAccessibility(SafeCategory) initWithImage:] + 70
8 金属和材料 0x0000bf09 -[TVCResults init] + 1841
9 金属和材料 0x00002b8c -[UIVCalcHolder init] + 258
10 金属和材料 0x00002758 -[CalcTestAppDelegate applicationDidFinishLaunching:] + 649
11 UIKit 0x002d759c -[UIApplication _callInitializationDelegatesForURL:有效负载:挂起:] + 1252
12 UIKit 0x002d99a1 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 346
13 UIKit 0x002e3452 -[UIApplication handleEvent:withNewEvent:] + 1958
14 UIKit 0x002dc074 -[UIApplication 发送事件:] + 71
15 UIKit 0x002e0ac4 _UIApplicationHandleEvent + 7495
16 图形服务 0x02de1afa PurpleEventCallback + 1578
17 CoreFoundation 0x025d6dc4 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION + 52
18 核心基础 0x02537737 __CFRunLoopDoSource1 + 215
19 核心基础 0x025349c3 __CFRunLoopRun + 979
20 CoreFoundation 0x02534280 CFRunLoopRunSpecific + 208
21 CoreFoundation 0x025341a1 CFRunLoopRunInMode + 97
22 UIKit 0x002d9226 -[UIApplication _run] + 625
23 UIKit 0x002e4b58 UIApplicationMain + 1160
24 金属和材料 0x000024ac main + 230
25 种金属和材料 0x000023bd start + 53
26 ??? 0x00000001 0x0 + 1
) 抛出“NSException”实例后调用终止
程序收到信号:“SIGABRT”。
杀死
杀死
这个 scale
方法对于 uiimageview 来说是新的吗?为什么它不起作用?有人遇到过这个吗?
非常感谢任何帮助,
最诚挚的问候
大卫
I have an application that has been running fine since its launch over a year ago.
I developed it with iphone iOS 2.2.1 originally and tested and kept selling it up until 3.2 without issues.
Now it fails to launch with iOS4.
the app uses a non standard size for a UIPickerView (I don't think that's the problem but just mention it as you will see some complaint in the console output). It's also giving previously non reported NSAutoreleasePool
warnings.
But the culprit seems to be when resizing the interface to the new iphone screen resolution (at least what I get from the console)
I know I have to do some research of my own but iOS4 has been out for so little and I have been very absorbed learning and developing my first app for android (so I have not tested this particular code, after a year+ this app only sells a few copies a day) that I thought it didn't harm to ask around here to check if someone has some info or has run into it already.
First, this is the console output when build and run with XCODE 3.2.3 and BASE SDK 3.2, runs without problem
2010-06-22 23:25:55.619 metalsandmaterials[82956:207] ******* Accessibility Status Changed: On
2010-06-22 23:25:55.710 metalsandmaterials[82956:207] ********** Loading AX for: xxxxxxxxx
But trying to run it with iOS4 gives this beauty:
2010-06-22 23:15:52.488 metalsandmaterials[80149:207] ******* Accessibility Status Changed: On
2010-06-22 23:15:52.546 metalsandmaterials[80149:207] ********** Loading AX for: XXXXXXX ************
2010-06-22 23:15:53.003 metalsandmaterials[80149:207] * -[NSAutoreleasePool release]: This pool has already been released, do not drain it (double release).
2010-06-22 23:15:53.005 metalsandmaterials[80149:207] * -[NSAutoreleasePool release]: This pool has already been released, do not drain it (double release).
2010-06-22 23:15:53.008 metalsandmaterials[80149:207] -[UIPickerView setFrame:]: invalid height value 50.0 pinned to 162.0
Right here! [UIIageView scale]
2010-06-22 23:15:53.011 metalsandmaterials[80149:207] -[UIImageView scale]: unrecognized selector sent to instance 0x5ac47a0
2010-06-22 23:15:53.013 metalsandmaterials[80149:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIImageView scale]: unrecognized selector sent to instance 0x5ac47a0'Call stack at first throw:
(
0 CoreFoundation 0x025f5919 exceptionPreprocess + 185
1 libobjc.A.dylib 0x027435de objc_exception_throw + 47
2 CoreFoundation 0x025f742b -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x02567116 ___forwarding_ + 966
4 CoreFoundation 0x02566cd2 _CF_forwarding_prep_0 + 50
5 UIKit 0x0039a8e3 -[UIImageView setImage:] + 250
6 UIKit 0x0039b63e -[UIImageView initWithImage:] + 161
7 UIKit 0x05f286ce -[UIImageViewAccessibility(SafeCategory) initWithImage:] + 70
8 metalsandmaterials 0x0000bf09 -[TVCResults init] + 1841
9 metalsandmaterials 0x00002b8c -[UIVCalcHolder init] + 258
10 metalsandmaterials 0x00002758 -[CalcTestAppDelegate applicationDidFinishLaunching:] + 649
11 UIKit 0x002d759c -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1252
12 UIKit 0x002d99a1 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 346
13 UIKit 0x002e3452 -[UIApplication handleEvent:withNewEvent:] + 1958
14 UIKit 0x002dc074 -[UIApplication sendEvent:] + 71
15 UIKit 0x002e0ac4 _UIApplicationHandleEvent + 7495
16 GraphicsServices 0x02de1afa PurpleEventCallback + 1578
17 CoreFoundation 0x025d6dc4 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION + 52
18 CoreFoundation 0x02537737 __CFRunLoopDoSource1 + 215
19 CoreFoundation 0x025349c3 __CFRunLoopRun + 979
20 CoreFoundation 0x02534280 CFRunLoopRunSpecific + 208
21 CoreFoundation 0x025341a1 CFRunLoopRunInMode + 97
22 UIKit 0x002d9226 -[UIApplication _run] + 625
23 UIKit 0x002e4b58 UIApplicationMain + 1160
24 metalsandmaterials 0x000024ac main + 230
25 metalsandmaterials 0x000023bd start + 53
26 ??? 0x00000001 0x0 + 1
)
terminate called after throwing an instance of 'NSException'
Program received signal: “SIGABRT”.
kill
kill
So this scale
method is new to uiimageview? why wouldn't it work? has anyone run into this already?
ANY HELP IS EXTREMELY APPRECIATED
best regards
david
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
通常当对象已被释放但您仍在尝试使用它时,您会收到一条消息“xxxxxx 无法识别选择器 yyyyyy”。此时,由于内存是随机的,系统认为它是其他某种随机类型的对象(如 UIImage)。因此,这是一个转移注意力的信号,表明有其他问题并且您过度释放了对象。
除非您使用自定义自动释放池执行某些操作,否则您不可能收到那些奇怪的自动释放消息。说起来,你在代码中使用 NSAutoreleasePool 做什么?
我认为它们可能与“无法识别选择器”消息有关,因为您可能因此而过度释放了东西。
You get a message "xxxxxx does not recognize selector yyyyyy" usually when an object has been released but you are still trying to use it. At that point because the memory is random, the system thinks it's some other random kind of object (like UIImage). Thus it's a red herring, a sign that something else is wrong and you are over-releasing an object.
There's no way you are getting those weird autorelease messages unless you are doing SOMETHING with a custom autorelease pool. Fess up, what are you doing with an NSAutoreleasePool in your code?
I think they are probably related to the "does not recognize selector" messages since you may be over-releasing things because of this.
好吧,对于 NSAutoreleasePool 的第一个问题,我将使用仪器,以便您可以跟踪额外的排水/释放来自何处。
您的第二个问题 doesNotRecognizeSelector 告诉您正在调用的选择器不存在(或丢失范围)。我将使用调试器,以便您可以再次跟踪代码执行。
Well, for your first issue with the NSAutoreleasePool, I would use instruments so you can trace where the extra drains/releases are coming from.
Your second issue doesNotRecognizeSelector is telling you that the selector that is being called doesn't exist (or lost scope). I would use the debugger so you can, again, trace that code execution.
好的,我离开了 if 在向 UIImageView 的子类添加 -(void)scale 并使用这个新类时。测试过,在 2.2.1、3.2 和 ios4 上都可以正常工作,在模拟器、带有 ios4 的 iphone touch 3g 和带有 ios3.2 的 ipad 上都可以。
我仍然需要拿到 iPhone4,看看是否会遇到一些奇怪的布局问题(我仍然相信当操作系统想要将东西升级到新的视网膜显示屏时,问题就会出现)。
不过,不在美国会让事情变得有点困难
Ok, I left if at adding a -(void)scale to a subclass of UIImageView and using this new class. Tested it, works fine on 2.2.1, 3.2 and ios4, both on simulator, iphone touch 3g with ios4 and ipad with ios3.2.
I still need to get ahold of an iphone4 and see if some weird layout problem comes across (I still believe the problems appeared when the Os want to blow things up to the new retina display).
Not being in the US is going to make it a tad hard though
我是否可以将 imageView 的 image 属性设置为另一个 UIImageView (而不是 UIImage)?
毕竟 UIImageView 不会响应 :scale,但 UIImage 会响应。
Could I be that you somewhere set the image property of an imageView to another UIImageView (as opposed to an UIImage)?
After all UIImageView does not respond to :scale, but UIImage does.