gpt4 book ai didi

ios - 启动时崩溃 - ios 8.1 因为添加了 UIButton 的 subview 。 EXC_BREAKPOINT(SIGTRAP)

转载 作者:行者123 更新时间:2023-11-29 02:01:43 25 4
gpt4 key购买 nike

我刚刚被 Apple 拒绝了,原因如下:

We were unable to review your app, as it crashed on launch on the following device(s): - iPhone 5S running iOS 8.1- iPhone 6 running iOS 8.1- iPhone 6 Plus running iOS 8.1

这是我所做的:

我确实使用模拟器 ios 8.1、8.2 中的设备对其进行了测试。我还使用读取设备对其进行了测试:运行 ios 7.1 的 iphone 4,运行 ios 8.3 的 ipad。根本没有发生任何崩溃。

根据他们发送的崩溃日志,我使用 Symbolicator生成以下符号日志:

Process:             Meety [1125]
Path: /private/var/mobile/Containers/Bundle/Application/12CA9A59-184C-4B7E-9D2A-0B4703363AA2/Meety.app/Meety
Identifier: com.cungcode.Meety
Version: 1 (1.0)
Code Type: ARM-64 (Native)
Parent Process: launchd.development [1]

Date/Time: 2015-05-16 05:34:46.952 -0700
Launch Time: 2015-05-16 05:34:46.165 -0700
OS Version: iOS 8.1 (12B411)
UDID: d1c1574d0e021ab0d30ce26e69978227c7080d3c
Report Version: 105

Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x000000010016bdf8
Triggered by Thread: 0

Filtered syslog:
2015-05-16 05:34:46.535 Meety[1125]: <Error> assertion failed: 12B411: libxpc.dylib + 71820 [AD580443-238D-3997-8D09-004C210D0C18]: 0x7d

Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
__TFC5Meety20MainTabBarController24addCenterButtonWithImagefS0_FTCSo7UIImage14highlightImageGSqS1___T_ MainTabBarController.swift:227
__TFC5Meety20MainTabBarController11viewDidLoadfS0_FT_T_ MainTabBarController.swift:57
2 UIKit 0x000000018a72ce80 0x18a71c000 + 69248
3 UIKit 0x000000018a72cb90 0x18a71c000 + 68496
4 UIKit 0x000000018a733258 0x18a71c000 + 94808
5 UIKit 0x000000018a7309d8 0x18a71c000 + 84440
6 UIKit 0x000000018a7a1a00 0x18a71c000 + 547328
7 UIKit 0x000000018a9b5434 0x18a71c000 + 2724916
8 UIKit 0x000000018a9b79ac 0x18a71c000 + 2734508
9 UIKit 0x000000018a9b6044 0x18a71c000 + 2728004
10 FrontBoardServices 0x000000018e2c163c 0x18e2a8000 + 103996
11 CoreFoundation 0x0000000185f36120 0x185e58000 + 909600
12 CoreFoundation 0x0000000185f35228 0x185e58000 + 905768
13 CoreFoundation 0x0000000185f3384c 0x185e58000 + 899148
14 CoreFoundation 0x0000000185e611f0 0x185e58000 + 37360
15 UIKit 0x000000018a797788 0x18a71c000 + 505736
16 UIKit 0x000000018a792780 0x18a71c000 + 485248
_main AppDelegate.swift:16
18 libdyld.dylib 0x0000000196dc6a04 0x196dc4000 + 10756

Thread 1 name: Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0 libsystem_kernel.dylib 0x0000000196ec4c94 0x196ec4000 + 3220
1 libdispatch.dylib 0x0000000196dac97c 0x196d9c000 + 67964
2 libdispatch.dylib 0x0000000196d9f3b0 0x196d9c000 + 13232

Thread 2:
0 libsystem_kernel.dylib 0x0000000196edfc78 0x196ec4000 + 113784
1 libsystem_pthread.dylib 0x0000000196f79390 0x196f78000 + 5008
2 libsystem_pthread.dylib 0x0000000196f78fa4 0x196f78000 + 4004

Thread 3:
0 libsystem_kernel.dylib 0x0000000196edfc78 0x196ec4000 + 113784
1 libsystem_pthread.dylib 0x0000000196f79390 0x196f78000 + 5008
2 libsystem_pthread.dylib 0x0000000196f78fa4 0x196f78000 + 4004

Thread 4:
0 libsystem_kernel.dylib 0x0000000196edfc78 0x196ec4000 + 113784
1 libsystem_pthread.dylib 0x0000000196f79390 0x196f78000 + 5008
2 libsystem_pthread.dylib 0x0000000196f78fa4 0x196f78000 + 4004

Thread 5:
0 libsystem_kernel.dylib 0x0000000196edfc78 0x196ec4000 + 113784
1 libsystem_pthread.dylib 0x0000000196f79390 0x196f78000 + 5008
2 libsystem_pthread.dylib 0x0000000196f78fa4 0x196f78000 + 4004

Thread 6:
0 libsystem_kernel.dylib 0x0000000196edfc78 0x196ec4000 + 113784
1 libsystem_pthread.dylib 0x0000000196f79390 0x196f78000 + 5008
2 libsystem_pthread.dylib 0x0000000196f78fa4 0x196f78000 + 4004

Thread 7:
0 libsystem_kernel.dylib 0x0000000196edfc78 0x196ec4000 + 113784
1 libsystem_pthread.dylib 0x0000000196f79390 0x196f78000 + 5008
2 libsystem_pthread.dylib 0x0000000196f78fa4 0x196f78000 + 4004

Thread 8:
0 libsystem_kernel.dylib 0x0000000196edfc78 0x196ec4000 + 113784
1 libsystem_pthread.dylib 0x0000000196f79390 0x196f78000 + 5008
2 libsystem_pthread.dylib 0x0000000196f78fa4 0x196f78000 + 4004

Thread 0 crashed with ARM Thread State (64-bit):
x0: 0x0000000000000000 x1: 0x0000000196f71958 x2: 0x000000015fd233e0 x3: 0x000000000000001e
x4: 0x0000000000000010 x5: 0x0000000000000001 x6: 0x0000000000000000 x7: 0x0000000000000000
x8: 0x0000000000000000 x9: 0x000000015fe0c850 x10: 0x0000000000000000 x11: 0x000000000000005e
x12: 0x0000000000000001 x13: 0x000000000017a17c x14: 0x0000000000000015 x15: 0x0000000000000000
x16: 0x0000000100a8217c x17: 0x0000000000000000 x18: 0x0000000000000000 x19: 0x00000001740995a0
x20: 0x00000001700997d0 x21: 0x000000015fe0c850 x22: 0x0000000000000000 x23: 0x000000015fd233e0
x24: 0x0000000100ab30c8 x25: 0x0000000100856dd0 x26: 0x0000000100856dd0 x27: 0x000000019aa4a0a8
x28: 0x0000000000000001 fp: 0x000000016fd1e160 lr: 0x000000010016b8c0
sp: 0x000000016fd1e100 pc: 0x000000010016bdf8 cpsr: 0x80000000

所以在我看来,这些错误一定存在于以下代码中:

(在 MainTabBarController 中)

@IBOutlet weak var mapButton: UIButton!

override func viewDidLoad()
{

super.viewDidLoad()
self.delegate = self
var middleImage:UIImage = UIImage(named:"MapButton")!
var highlightedMiddleImage:UIImage = UIImage(named:"MapButtonHighlighted")!
addCenterButtonWithImage(middleImage, highlightImage: highlightedMiddleImage) //Line 57 --> Correct!!
self.tabBar.barTintColor = UIColor.blackColor()

}

func addCenterButtonWithImage(buttonImage: UIImage, highlightImage:UIImage?)
{
mapButton = UIButton.buttonWithType(UIButtonType.Custom) as UIButton //UPDATE 1: LINE 206 --> CRASH HERE
mapButton.autoresizingMask = UIViewAutoresizing.FlexibleBottomMargin|UIViewAutoresizing.FlexibleLeftMargin|UIViewAutoresizing.FlexibleRightMargin|UIViewAutoresizing.FlexibleTopMargin

mapButton.frame = CGRectMake(0.0, 0.0, buttonImage.size.width, buttonImage.size.height);
mapButton.setBackgroundImage(buttonImage, forState: UIControlState.Normal)
mapButton.setBackgroundImage(highlightImage, forState: UIControlState.Highlighted)
//Center the button on tabbar
var heightDifference:CGFloat = buttonImage.size.height - self.tabBar.frame.size.height;

if heightDifference < 0 {
mapButton.center = self.tabBar.center;
}
else
{
var center:CGPoint = self.tabBar.center;
center.y = center.y - heightDifference/2.0;
mapButton.center = center;
}

mapButton.addTarget(self, action: "changeSelectedTabToMapTabController:", forControlEvents: UIControlEvents.TouchUpInside)

self.view.addSubview(mapButton)
} //LINE 227: PROBABLY CRASH HERE, BUT I THINK IT CRASH ON LINE 206

上面代码的意思是,我想创建一个类似Instagram的标签栏。因此,我在 5 项选项卡栏中的 3 选项卡前面添加了一个按钮。在模拟器 ios 8.1 中,如下所示:

enter image description here

1) 代码很简单,我不知道为什么它在 ios 8.1 中崩溃。目前我没有运行ios 8.1的真实设备来测试它,所以我想问你是否可以在代码中发现异常的东西。

2) 应用程序是否可能因配置文件出现问题而崩溃?但我认为这不是我的情况,因为我使用分发配置文件进行存档,并通过 iTunes 和 TestFlight 将 ipa 安装到我的 ipad 上,它可以正常运行。

抱歉,问题很长。任何帮助将不胜感激!

更新1:我通过命令行再次确认崩溃,如西藏海岸在here中的回答所述。 。然后我得到崩溃必须在代码的第206行:

mapButton = UIButton.buttonWithType(UIButtonType.Custom) as UIButton

这种启动肯定有问题。我不使用 Storyboard来创建此按钮,而是以编程方式创建。我的 friend 使用 XCode 6.3(我使用的是 6.2),当打开我的项目时,看到很多与“as”、“!”相关的编译错误。和 ”?”。我想我要把我的 XCode 更新到 6.3,看看第 206 行中的“as”是否有编译错误。

最佳答案

只需通过将运行选项卡的编辑方案中的构建配置设置为发布来检查应用程序的运行情况,看看是否仍然发生崩溃,这将有助于您进行调试,因为构建在 Release模式下崩溃了。我觉得这主要是一个 swift 编译器问题,如果是这样,您可以通过将 swift 编译器优化从最快更改为无来避免它。我不确定这是否是一个理想的解决方案,但看看这是否有帮助。 :]

关于ios - 启动时崩溃 - ios 8.1 因为添加了 UIButton 的 subview 。 EXC_BREAKPOINT(SIGTRAP),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30289151/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com