相关疑难解决方法(0)

在Xcode 4.2/iOS 5下的控制台中没有异常堆栈跟踪?

在Xcode 3.x和iOS 4下,如果在模拟器中发出未处理的异常信号,则在控制台输出中会产生异常堆栈跟踪(类似于Java).

当我在Xcode 4.2下的iOS 5中引发未处理的异常时,运行完全相同的应用程序代码,不会发生堆栈跟踪.(我确实弄清楚如何设置异常断点,但这不会在控制台中产生回溯.)

这仅仅是我需要在某处创建的Xcode设置,还是Xcode 4/iOS 5的"功能"?有没有办法恢复这一点功能?

更新

不幸的是,添加一个uncaughtExceptionHandler不起作用.这是处理程序:

void uncaughtExceptionHandler(NSException *exception) {
    NSLog(@"uncaughtExceptionHnadler -- Exception %@", [exception description]);
    // Because iOS 5 doesn't provide a traceback, provide one here
    NSLog(@"Stack trace: %@", [exception callStackSymbols]);
    // Let Flurry look at the error
    [FlurryAPI logError:@"Uncaught" message:@"Crash!" exception:exception];
}                                               
Run Code Online (Sandbox Code Playgroud)

(事实证明它已经存在,做Flurry的事情,所以我只是添加了堆栈跟踪.)

这是它启用的地方(只在声明处理程序的下面几行):

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    // Enable uncaught exception handler to dump stack and let Flurry log the exception
    NSUncaughtExceptionHandler* hdlr = NSGetUncaughtExceptionHandler();
    NSSetUncaughtExceptionHandler(&uncaughtExceptionHandler);
    NSUncaughtExceptionHandler* newHdlr …
Run Code Online (Sandbox Code Playgroud)

ios5 xcode4.2

48
推荐指数
1
解决办法
2万
查看次数

iOS图表,Swift 2.1.1 Xcode 7.2似乎不起作用,

我在两周内遇到了麻烦,所以请让我提问.

情况

XCode 7.2 Apple Swift 2.1.1版(swiftlang-700.1.101.15 clang-700.1.81) https://github.com/yosuke1985/ios-charts

iOS Chart ttps://github.com/danielgindi/ios-charts

这段代码来自

TTP://www.appcoda.com/ios-charts-api-tutorial/

我想要的是

我想使用这个框架,但错误是EXEC_BAC_ACCESS,

我只通过StoryBoard将窗口对象放在Viewcontroller上,并作为BarChartView类连接.

并且想要显示条形图,当我更改属性时,"noDataText"和"noDataTextDescription"它不起作用,并且无法弄清楚错误来自.

    barChartView.noDataText = "there is no data"
    barChartView.noDataTextDescription = "give me the reason"
Run Code Online (Sandbox Code Playgroud)

只有这些代码不起作用,我开始认为问题来自Swift或XCode的版本?请给我建议解决这个问题.

错误

EXEC_BAC_ACCESS ERROR,屏幕截图

import UIKit
import Charts

class ViewController: UIViewController {
var months: [String]!


@IBOutlet weak var barChartView: BarChartView!
override func viewDidLoad() {
    super.viewDidLoad()
    // Do any additional setup after loading the view, typically from a nib.
    barChartView.noDataText = "there is no data"
    barChartView.noDataTextDescription = "give me the reason" …
Run Code Online (Sandbox Code Playgroud)

xcode ios swift ios-charts

3
推荐指数
1
解决办法
820
查看次数

标签 统计

ios ×1

ios-charts ×1

ios5 ×1

swift ×1

xcode ×1

xcode4.2 ×1