I'm struggling with the proper navigation and experience a crash, once I go back to the Main-Site. That happens on my iOS device and the virtual devices.
My structure is as follows:
Dependencies in my package.json:
"dependencies": {
"#nativescript/core": "7.1.3",
"#nativescript/theme": "3.0.1",
"#nstudio/nativescript-cardview": "2.0.1",
"axios": "^0.19.2",
"js-cookie": "^2.2.1",
"kinvey-nativescript-sdk": "6.0.0",
"moment": "^2.24.0",
"nativescript-background-http": "4.2.1",
"nativescript-camera": "4.5.0",
"nativescript-fonticon": "^2.0.0",
"nativescript-http-formdata": "^2.1.0",
"nativescript-image": "3.0.1",
"nativescript-imagepicker": "7.1.0",
"nativescript-intl": "3.0.0",
"nativescript-iqkeyboardmanager": "1.5.1",
"nativescript-theme-core": "2.0.24",
"nativescript-ui-autocomplete": "7.0.2",
"nativescript-ui-calendar": "6.1.0",
"nativescript-ui-chart": "7.1.1",
"nativescript-ui-dataform": "7.0.4",
"nativescript-ui-gauge": "6.0.0",
"nativescript-ui-listview": "8.0.1",
"nativescript-ui-sidedrawer": "8.0.0",
"nativescript-vue": "2.8.3",
"terser-webpack-plugin": "^2.3.5",
"vform": "^1.0.1",
"vue-i18n": "^8.17.0",
"vuex": "^3.1.3"
}
app.js
new Vue({
store,
render: h => h('frame', [h(routes.login)]),
created() {
},
}).$start();
After after the successful Login, I will be redirected to Main.vue.
Main.vue contains following (Bottom Navigation and included component for main menu -> Home):
<template>
<Page actionBarHidden="true">
<ActionBar title="App-Name"></ActionBar>
<StackLayout>
<StackLayout>
<BottomNavigation height="auto">
<TabStrip>
<TabStripItem>
<Label text="Home"></Label>
<Image src="res://home"></Image>
</TabStripItem>
<TabStripItem>
<Label text="Einstellungen"></Label>
<Image src="res://settings"></Image>
</TabStripItem>
<TabStripItem>
<Label text="Info"></Label>
<Image src="res://browse"></Image>
</TabStripItem>
</TabStrip>
<TabContentItem>
<GridLayout>
<Home></Home>
</GridLayout>
</TabContentItem>
<TabContentItem>
<GridLayout>
<Settings></Settings>
</GridLayout>
</TabContentItem>
<TabContentItem>
<GridLayout>
<Info></Info>
</GridLayout>
</TabContentItem>
</BottomNavigation>
</StackLayout>
</StackLayout>
</Page>
</template>
The Home Component which contains the main menu, looks like that:
<template> </template>
and contains card which has a #tap function to go to the next page.
methods: {
logout() {
this.$store.dispatch("clearUser");
},
goToPageXY() {
this.$navigateTo(PageXY, {
clearHistory: false,
});
},
},
The page that is called via tap (PageXY in that case) contains this structure:
<template>
<Page class="page">
</Page>
</template>
The further navigation in 'deeper' pages works as expected and I can use the "Go back" button as I need to.
Problem:
Once I want to navigate back to the Main.vue (From PageXY back via history-mode ON or $navigateTo / $navigateBack) the App crashes. This only happens on that page.
The error output is following:
***** Fatal JavaScript exception - application has been terminated. *****
Native stack trace:
1 0x10de4b62e NativeScript::reportFatalErrorBeforeShutdown(JSC::ExecState*, JSC::Exception*, bool)
2 0x10de8c3a8 NativeScript::FFICallback<NativeScript::ObjCMethodCallback>::ffiClosureCallback(ffi_cif*, void*, void**, void*)
3 0x10e887c90 ffi_closure_unix64_inner
4 0x10e8886b2 ffi_closure_unix64
5 0x7fff23f47ce3 -[UIViewController __viewDidAppear:]
6 0x7fff23f47fbc -[UIViewController _endAppearanceTransition:]
7 0x7fff23e6d6a3 -[UINavigationController navigationTransitionView:didEndTransition:fromView:toView:]
8 0x7fff23e62284 __49-[UINavigationController _startCustomTransition:]_block_invoke
9 0x7fff23f6c4b8 -[_UIViewControllerTransitionContext completeTransition:]
10 0x7fff23f83680 __53-[_UINavigationParallaxTransition animateTransition:]_block_invoke.155
11 0x7fff24bcb250 -[UIViewAnimationBlockDelegate _didEndBlockAnimation:finished:context:]
12 0x7fff24b9bb62 -[UIViewAnimationState sendDelegateAnimationDidStop:finished:]
13 0x7fff24b9c101 -[UIViewAnimationState animationDidStop:finished:]
14 0x7fff24b9c285 -[UIViewAnimationState animationDidStop:finished:]
15 0x7fff27a8a4f6 CA::Layer::run_animation_callbacks(void*)
16 0x7fff20106508 _dispatch_client_callout
17 0x7fff20112ff7 _dispatch_main_queue_callback_4CF
18 0x7fff2038bdab __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
19 0x7fff2038662e __CFRunLoopRun
20 0x7fff203856c6 CFRunLoopRunSpecific
21 0x7fff2b76adb3 GSEventRunModal
22 0x7fff24675187 -[UIApplication _run]
23 0x7fff2467a038 UIApplicationMain
24 0x10e8884f5 ffi_call_unix64
25 0x115a85090
JavaScript stack trace:
file: node_modules/nativescript-vue/dist/index.js:4880:17
at destroy(file: node_modules/nativescript-vue/dist/index.js:4046:8)
at invokeDestroyHook(file: node_modules/nativescript-vue/dist/index.js:5455:60)
at patch(file: node_modules/nativescript-vue/dist/index.js:5808:47)
at file: node_modules/nativescript-vue/dist/index.js:4886:17
at handler(file: node_modules/nativescript-vue/dist/index.js:12773:12)
at _handleEvent(file: app/packages/core/data/observable/index.ts:296:19)
at notify(file: app/packages/core/data/observable/index.ts:278:27)
at onNavigatedFrom(file: app/packages/core/ui/page/page-common.ts:139:14)
at raiseCurrentPageNavigatedEvents(file: app/packages/core/ui/frame/frame-common.ts:310:24)
at _updateBackstack(file: app/packages/core/ui/frame/frame-common.ts:268:39)
at setCurrent(file: app/packages/core/ui/frame/index.ios.ts:58:25)
at file:///app/vendor.js:39242:23
at UIApplicationMain([native code])
at run(file: app/packages/core/application/index.ios.ts:395:20)
at file: node_modules/nativescript-vue/dist/index.js:12548:23
at file:///app/bundle.js:6582:10
at ./app.js(file:///app/bundle.js:6586:34)
at __webpack_require__(file: app/webpack/bootstrap:750:0)
at checkDeferredModules(file: app/webpack/bootstrap:43:0)
at webpackJsonpCallback(file: app/webpack/bootstrap:30:0)
at anonymous(file:///app/bundle.js:2:61)
at evaluate([native code])
at moduleEv<…>
JavaScript error:
file: node_modules/nativescript-vue/dist/index.js:4880:17: JS ERROR TypeError: undefined is not an object (evaluating 'vm._data.__ob__')
***** Fatal JavaScript exception - application has been terminated. *****
My feeling tells me, that I did mistakes when it comes to using Pages / Frames.
I would really appreciate any kind of help, since I'm struggling with that for hours already.
Thank you very much!
If you are using frame
try this
this.$navigateTo(PageXY, {
frame: 'frame',
});
to go back try this:
this.$navigateBack({frame: "frame"});
Related
I'm always getting a Segmentation fault: 11 error when compiling.
I have massively stripped back my code to identify the nuances of what is causing the issue and have produced the demo code below that exhibits the exact same problem.
Can anyone suggest any way to resolve this issue (thats different to what I have already highlight in the code comments)?
PS: this Swift 5 code and occurs with both Xcode 11.7 and Xcode 12
// If we make this a class instead, it compiles! (but I want it to be a struct)
struct SomeStruct {
// If we remove either of these properties or change them to an Int, it compiles! (but I obviously need 2 strings)
let propertyA: String
let propertyB: String
}
protocol Protocol { }
enum Enumeration {
// If we remove this case, it compiles! (but I need this case, and the protocol also)
case possibilityA(protocol: Protocol)
// If we add additional associated values to this case, it compiles! (but I need this case)
case possibilityB(completion: (Result<SomeStruct, Error>) -> ())
}
class SomeClass {
func method() {
// If we remove the use of `possibilityB`, it compiles! (but I need this)
_ = Enumeration.possibilityB(completion: { _ in
})
}
}
Here's the stack dump...
Stack dump:
0. Program arguments: /Applications/Xcode_12.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c -primary-file /Users/x/Demo/Sources/Demo/Demo.swift -emit-module-path /Users/x/Library/Developer/Xcode/DerivedData/Demo-hjukrlyoxxzhqwasgqzluieckmux/Build/Intermediates.noindex/Demo.build/Debug-iphoneos/Demo.build/Objects-normal/arm64/Demo~partial.swiftmodule -emit-module-doc-path /Users/x/Library/Developer/Xcode/DerivedData/Demo-hjukrlyoxxzhqwasgqzluieckmux/Build/Intermediates.noindex/Demo.build/Debug-iphoneos/Demo.build/Objects-normal/arm64/Demo~partial.swiftdoc -emit-module-source-info-path /Users/x/Library/Developer/Xcode/DerivedData/Demo-hjukrlyoxxzhqwasgqzluieckmux/Build/Intermediates.noindex/Demo.build/Debug-iphoneos/Demo.build/Objects-normal/arm64/Demo~partial.swiftsourceinfo -serialize-diagnostics-path /Users/x/Library/Developer/Xcode/DerivedData/Demo-hjukrlyoxxzhqwasgqzluieckmux/Build/Intermediates.noindex/Demo.build/Debug-iphoneos/Demo.build/Objects-normal/arm64/Demo.dia -emit-dependencies-path /Users/x/Library/Developer/Xcode/DerivedData/Demo-hjukrlyoxxzhqwasgqzluieckmux/Build/Intermediates.noindex/Demo.build/Debug-iphoneos/Demo.build/Objects-normal/arm64/Demo.d -emit-reference-dependencies-path /Users/x/Library/Developer/Xcode/DerivedData/Demo-hjukrlyoxxzhqwasgqzluieckmux/Build/Intermediates.noindex/Demo.build/Debug-iphoneos/Demo.build/Objects-normal/arm64/Demo.swiftdeps -target arm64-apple-ios9.0 -Xllvm -aarch64-use-tbi -enable-objc-interop -sdk /Applications/Xcode_12.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk -I /Users/x/Library/Developer/Xcode/DerivedData/Demo-hjukrlyoxxzhqwasgqzluieckmux/Build/Products/Debug-iphoneos -I /Applications/Xcode_12.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/lib -F /Users/x/Library/Developer/Xcode/DerivedData/Demo-hjukrlyoxxzhqwasgqzluieckmux/Build/Products/Debug-iphoneos -F /Applications/Xcode_12.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Frameworks -F /Applications/Xcode_12.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk/Developer/Library/Frameworks -enable-testing -g -module-cache-path /Users/x/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -swift-version 5 -enforce-exclusivity=checked -Onone -D SWIFT_PACKAGE -D DEBUG -D Xcode -serialize-debugging-options -Xcc -working-directory -Xcc /Users/x/Demo -enable-anonymous-context-mangled-names -Xcc -I/Users/x/Library/Developer/Xcode/DerivedData/Demo-hjukrlyoxxzhqwasgqzluieckmux/Build/Intermediates.noindex/Demo.build/Debug-iphoneos/Demo.build/swift-overrides.hmap -Xcc -I/Users/x/Library/Developer/Xcode/DerivedData/Demo-hjukrlyoxxzhqwasgqzluieckmux/Build/Products/Debug-iphoneos/include -Xcc -I/Users/x/Library/Developer/Xcode/DerivedData/Demo-hjukrlyoxxzhqwasgqzluieckmux/Build/Intermediates.noindex/Demo.build/Debug-iphoneos/Demo.build/DerivedSources-normal/arm64 -Xcc -I/Users/x/Library/Developer/Xcode/DerivedData/Demo-hjukrlyoxxzhqwasgqzluieckmux/Build/Intermediates.noindex/Demo.build/Debug-iphoneos/Demo.build/DerivedSources/arm64 -Xcc -I/Users/x/Library/Developer/Xcode/DerivedData/Demo-hjukrlyoxxzhqwasgqzluieckmux/Build/Intermediates.noindex/Demo.build/Debug-iphoneos/Demo.build/DerivedSources -Xcc -DSWIFT_PACKAGE -Xcc -DDEBUG=1 -target-sdk-version 14.0 -parse-as-library -module-name Demo -o /Users/x/Library/Developer/Xcode/DerivedData/Demo-hjukrlyoxxzhqwasgqzluieckmux/Build/Intermediates.noindex/Demo.build/Debug-iphoneos/Demo.build/Objects-normal/arm64/Demo.o -embed-bitcode-marker -index-store-path /Users/x/Library/Developer/Xcode/DerivedData/Demo-hjukrlyoxxzhqwasgqzluieckmux/Index/DataStore -index-system-modules
1. Apple Swift version 5.3 (swiftlang-1200.0.29.2 clang-1200.0.30.1)
2. While evaluating request IRGenSourceFileRequest(IR Generation for file "/Users/x/Demo/Sources/Demo/Demo.swift")
3. While emitting IR SIL function "#$s8Demo9SomeClassC6methodyyF".
for 'method()' (at /Users/x/Demo/Sources/Demo/Demo.swift:21:5)
4. While converting type '(#callee_guaranteed (#in_guaranteed Result<SomeStruct, Error>) -> ())'
0 swift 0x0000000107a19865 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 37
1 swift 0x0000000107a18865 llvm::sys::RunSignalHandlers() + 85
2 swift 0x0000000107a19e1f SignalHandler(int) + 111
3 libsystem_platform.dylib 0x00007fff68acc5fd _sigtramp + 29
4 libsystem_platform.dylib 0x0000000000000004 _sigtramp + 18446603338760010276
5 swift 0x00000001039794d8 swift::SILInstructionVisitor<(anonymous namespace)::IRGenSILFunction, void>::visit(swift::SILInstruction*) + 21400
6 swift 0x000000010396fc26 swift::irgen::IRGenModule::emitSILFunction(swift::SILFunction*) + 8982
7 swift 0x0000000103809dc7 swift::irgen::IRGenerator::emitGlobalTopLevel(llvm::StringSet<llvm::MallocAllocator>*) + 1607
8 swift 0x00000001039449d7 performIRGeneration(swift::IRGenOptions const&, swift::ModuleDecl*, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule> >, llvm::StringRef, swift::PrimarySpecificPaths const&, llvm::StringRef, swift::SourceFile*, llvm::GlobalVariable**, llvm::StringSet<llvm::MallocAllocator>*) + 1687
9 swift 0x000000010396d681 swift::SimpleRequest<swift::IRGenSourceFileRequest, swift::GeneratedModule (swift::IRGenDescriptor), (swift::RequestFlags)9>::evaluateRequest(swift::IRGenSourceFileRequest const&, swift::Evaluator&) + 97
10 swift 0x0000000103948dec llvm::Expected<swift::IRGenSourceFileRequest::OutputType> swift::Evaluator::getResultUncached<swift::IRGenSourceFileRequest>(swift::IRGenSourceFileRequest const&) + 940
11 swift 0x000000010394503d swift::performIRGeneration(swift::IRGenOptions const&, swift::SourceFile&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule> >, llvm::StringRef, swift::PrimarySpecificPaths const&, llvm::StringRef, llvm::GlobalVariable**, llvm::StringSet<llvm::MallocAllocator>*) + 269
12 swift 0x0000000103590d3a performCompileStepsPostSILGen(swift::CompilerInstance&, swift::CompilerInvocation const&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule> >, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::PrimarySpecificPaths const&, int&, swift::FrontendObserver*) + 3002
13 swift 0x0000000103580928 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 20712
14 swift 0x0000000103501c07 main + 1255
15 libdyld.dylib 0x00007fff688d3cc9 start + 1
16 libdyld.dylib 0x000000000000004f start + 18446603338762077063
error: Segmentation fault: 11 (in target 'Demo' from project 'Demo')
Naming the enum associated values is a shadow zone. While it is apparently accepted under certain conditions, it is not used or even mentioned in the official Swift Language Guide chapter on Enumerations. So in this case, your code compiles fine if you remove the naming.
enum Enumeration {
case possibilityA(Protocol)
case possibilityB((Result<SomeStruct, Error>) -> ())
}
...
func method() {
let _ = Enumeration.possibilityB({ _ in
})
In any case, a crashing compiler is never nice, no matter how bad code you feed it, and furthermore you got a pretty cool minimal test, so filling a report should be your duty and honor :)
I'm having a smartwatch app on watchos2. The app always worked but now when it starts I immediately get this error:
Lop_WatchKit_Extension[17535:7854201] *********** ERROR -[SPRemoteInterface _interfaceControllerClientIDForControllerID:] clientIdentifier for interfaceControllerID:447E0002 not found
I found some topics here on stackoverflow but nothing solved the problem.
In my case, this was due to a retain cycle in one InterfaceController of mine.
If you get the logs similar to:
[default] -[SPRemoteInterface
_interfaceControllerClientIDForControllerID:]:0000: ComF: clientIdentifier for interfaceControllerID:XXXXXXXX not found
&/or...
[default] _SendRecordedValues:000: ComF:<-Plugin controller ID
XXXXXXXX has no client identifier
First, figure out which InterfaceController has the controller ID XXXXXXXX.
Have this in awake(withContext:)
override func awake(withContext context: Any?) {
//...
if let id = self.value(forKey: "_viewControllerID") as? NSString {
let strClassDescription = String(describing: self)
print("\(strClassDescription) has the Interface Controller ID \(id)")
}
//...
}
This logs:
[Target.Classname: 0xYYYYYYYY] has the Interface Controller ID
XXXXXXXX
Once you identify the InterfaceController causing these logs, you can continue to debug.
It could be different in your case but in mine I had created a retain cycle with self in one of my closures within which took awhile to locate but I eventually broke the retain cycle with a [weak self] capture.
Basically, the error logs appear when an InterfaceController is trying to execute some code but it has already been released.
What I already had:
DispatchQueue.main.async {
self.doSomethingThatDoesSomethingAsync()
}
What I fixed:
DispatchQueue.main.async { [weak self] in
self?.doSomethingThatDoesSomethingAsync()
}
If you use didSet on any IBOutlets it will also throw this error in the logs.
class MyInterfaceController: WKInterfaceController {
#IBOutlet var myLabel: WKInterfaceLabel! {
didSet {
myLabel.setTitle("Test")
}
}
How #nickromano sad, it's happens when you use didSet with IBOutlets. Cause it's calls before awake(withContext context: Any?)
We can suppress this error if wrap it in DispatchQueue.main.async
#IBOutlet var statusLabel: WKInterfaceLabel! {
didSet {
DispatchQueue.main.async {
self.statusLabel.setHidden(true)
}
}
This has happened to me a few times and more times than not, it is because of a timer that is still firing in a just-previously dismissed WKInterfaceController that I did not catch.
Best thing to do aside from comparing ID's like in #staticVoidMan's answer is to read the call stack. In my case I was able to identify that the old timer was still firing based off these hints:
8 Foundation 0x00007fff214be867 __NSFireTimer + 67
9 CoreFoundation 0x00007fff207a8e3f __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
10 CoreFoundation 0x00007fff207a8912 __CFRunLoopDoTimer + 926
Here is the original call stack (for reference):
<MyApp.InterfaceController: 0x7fb3e4d2d020> has the Interface Controller ID 1EB00002
2021-05-26 14:44:06.632758-0600 MyApp WatchKit Extension[73392:3546879] [default] -[SPRemoteInterface _interfaceControllerClientIDForControllerID:]:2464: ComF: clientIdentifier for interfaceControllerID:1EB00007 not found. callStack:(
0 WatchKit 0x00007fff38d1a268 -[SPRemoteInterface _interfaceControllerClientIDForControllerID:] + 220
1 WatchKit 0x00007fff38d1bfff __54+[SPRemoteInterface setController:key:property:value:]_block_invoke + 340
2 WatchKit 0x00007fff38d12323 spUtils_dispatchAsyncToMainThread + 30
3 WatchKit 0x00007fff38d1be60 +[SPRemoteInterface setController:key:property:value:] + 179
4 WatchKit 0x00007fff38d057af -[WKInterfaceObject _sendValueChanged:forProperty:] + 706
5 WatchKit 0x00007fff38d2a5f8 -[WKInterfaceObject _setImage:forProperty:] + 50
6 MyApp WatchKit Extension 0x000000010955531d $s26MyApp_WatchKit_Extension25ActivityIndicatorDelegateC06handleE5TimeryyF + 813
7 MyApp WatchKit Extension 0x000000010955537a $s26MyApp_WatchKit_Extension25ActivityIndicatorDelegateC06handleE5TimeryyFTo + 42
8 Foundation 0x00007fff214be867 __NSFireTimer + 67
9 CoreFoundation 0x00007fff207a8e3f __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
10 CoreFoundation 0x00007fff207a8912 __CFRunLoopDoTimer + 926
11 CoreFoundation 0x00007fff207a7ec5 __CFRunLoopDoTimers + 265
12 CoreFoundation 0x00007fff207a2546 __CFRunLoopRun + 1949
13 CoreFoundation 0x00007fff207a18be CFRunLoopRunSpecific + 567
14 GraphicsServices 0x00007fff25b49fd3 GSEventRunModal + 139
15 UIKitCore 0x00007fff43290f24 -[UIApplication _run] + 917
16 UIKitCore 0x00007fff43295c0b UIApplicationMain + 101
17 WatchKit 0x00007fff38d0de65 WKExtensionMain + 800
18 libdyld.dylib 0x00007fff20202db5 start + 1
19 ??? 0x0000000000000001 0x0 + 1
)
Have you changed the name of your module? If this is the case then you have to go through your storyboard and update it manually for all the Interfaces you have.
Edit with steps to fix:
Go to the storyboard and for each interface open the Identity inspector, then delete what's in Module and press enter, the new module should get auto-filled.
I have several webviews in my app. Few of the webviews will have a textfield in them.
When running the app initially, on entering some text in the textfield and hitting the 'Done' button on the keyboard causes the app to crash. If I relaunch the app and try the same scenario, it works fine.
I am running few Javascript files as well in the WebView.
This is the error thrown:
EXC_BAD_ACCESS mh_execute_header
Attempted to dereference null pointer.
This is the trace I got from the crash details:
/usr/lib/libobjc.A.dylib:0objc_msgSend
Frameworks/UIKit.framework/UIKit:0-[_UIWebViewScrollViewDelegateForwarder forwardInvocation:]
Frameworks/CoreFoundation.framework/CoreFoundation:0___forwarding___
Frameworks/CoreFoundation.framework/CoreFoundation:0__forwarding_prep_0___
Frameworks/UIKit.framework/UIKit:0-[UIScrollView _getDelegateZoomView]
Frameworks/UIKit.framework/UIKit:0-[UIScrollView _zoomScaleFromPresentationLayer:]
Frameworks/UIKit.framework/UIKit:0-[UIWebDocumentView _zoomedDocumentScale]
Frameworks/UIKit.framework/UIKit:0-[UIWebDocumentView _layoutRectForFixedPositionObjects]
Frameworks/UIKit.framework/UIKit:0-[UIWebDocumentView _updateFixedPositionedObjectsLayoutRectUsingWebThread:synchronize:]
Frameworks/UIKit.framework/UIKit:0-[UIWebDocumentView _updateFixedPositioningObjectsLayoutAfterScroll]
Frameworks/UIKit.framework/UIKit:0-[UIWebBrowserView _updateFixedPositioningObjectsLayoutAfterScroll]
Frameworks/CoreFoundation.framework/CoreFoundation:0__CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__
Frameworks/CoreFoundation.framework/CoreFoundation:0_CFXRegistrationPost
Frameworks/CoreFoundation.framework/CoreFoundation:0___CFXNotificationPost_block_invoke
Frameworks/CoreFoundation.framework/CoreFoundation:0-[_CFXNotificationRegistrar find:object:observer:enumerator:]
Frameworks/CoreFoundation.framework/CoreFoundation:0_CFXNotificationPost
Frameworks/Foundation.framework/Foundation:0-[NSNotificationCenter postNotificationName:object:userInfo:]
Frameworks/UIKit.framework/UIKit:0-[UIInputWindowController postEndNotifications:withInfo:]
Frameworks/UIKit.framework/UIKit:0__77-[UIInputWindowController moveFromPlacement:toPlacement:starting:completion:]_block_invoke_2896
Frameworks/UIKit.framework/UIKit:0-[UIInputWindowController performWithSafeTransitionFrames:]
Frameworks/UIKit.framework/UIKit:0__77-[UIInputWindowController moveFromPlacement:toPlacement:starting:completion:]_block_invoke887
Frameworks/UIKit.framework/UIKit:0-[UIViewAnimationBlockDelegate _didEndBlockAnimation:finished:context:]
Frameworks/UIKit.framework/UIKit:0-[UIViewAnimationState sendDelegateAnimationDidStop:finished:]
Frameworks/UIKit.framework/UIKit:0-[UIViewAnimationState animationDidStop:finished:]
Frameworks/QuartzCore.framework/QuartzCore:0<redacted>
/usr/lib/system/libdispatch.dylib:0_dispatch_client_callout
/usr/lib/system/libdispatch.dylib:0_dispatch_main_queue_callback_4CF
Frameworks/CoreFoundation.framework/CoreFoundation:0__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
Frameworks/CoreFoundation.framework/CoreFoundation:0__CFRunLoopRun
Frameworks/CoreFoundation.framework/CoreFoundation:0CFRunLoopRunSpecific
PrivateFrameworks/GraphicsServices.framework/GraphicsServices:0GSEventRunModal
Frameworks/UIKit.framework/UIKit:0-[UIApplication runModal:]
Frameworks/UIKit.framework/UIKit:0-[UIAlertView _showAnimated:]
Frameworks/UIKit.framework/UIKit:0-[UIWebView webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:]
Frameworks/CoreFoundation.framework/CoreFoundation:0__invoking___
Frameworks/CoreFoundation.framework/CoreFoundation:0-[NSInvocation invoke]
Frameworks/CoreFoundation.framework/CoreFoundation:0-[NSInvocation invokeWithTarget:]
PrivateFrameworks/WebKitLegacy.framework/WebKitLegacy:0<redacted>
Frameworks/CoreFoundation.framework/CoreFoundation:0___forwarding___
Frameworks/CoreFoundation.framework/CoreFoundation:0__forwarding_prep_0___
PrivateFrameworks/WebKitLegacy.framework/WebKitLegacy:0<redacted>
PrivateFrameworks/WebCore.framework/WebCore:0<redacted>
PrivateFrameworks/WebCore.framework/WebCore:0<redacted>
Frameworks/JavaScriptCore.framework/JavaScriptCore:0<redacted>
Frameworks/JavaScriptCore.framework/JavaScriptCore:0<redacted>
Frameworks/JavaScriptCore.framework/JavaScriptCore:0<redacted>
Frameworks/JavaScriptCore.framework/JavaScriptCore:0<redacted>
Frameworks/JavaScriptCore.framework/JavaScriptCore:0<redacted>
Frameworks/JavaScriptCore.framework/JavaScriptCore:0<redacted>
Frameworks/JavaScriptCore.framework/JavaScriptCore:0<redacted>
Frameworks/JavaScriptCore.framework/JavaScriptCore:0JSC::call(JSC::ExecState*, JSC::JSValue, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&, WTF::NakedPtr<JSC::Exception>&)
PrivateFrameworks/WebCore.framework/WebCore:0<redacted>
PrivateFrameworks/WebCore.framework/WebCore:0<redacted>
PrivateFrameworks/WebCore.framework/WebCore:0<redacted>
PrivateFrameworks/WebCore.framework/WebCore:0<redacted>
PrivateFrameworks/WebCore.framework/WebCore:0<redacted>
PrivateFrameworks/WebCore.framework/WebCore:0<redacted>
PrivateFrameworks/WebCore.framework/WebCore:0WebCore::EventHandler::keyEvent(WebCore::PlatformKeyboardEvent const&)
PrivateFrameworks/WebCore.framework/WebCore:0WebCore::EventHandler::keyEvent(WebEvent*)
Frameworks/CoreFoundation.framework/CoreFoundation:0__invoking___
Frameworks/CoreFoundation.framework/CoreFoundation:0-[NSInvocation invoke]
Frameworks/CoreFoundation.framework/CoreFoundation:0-[NSInvocation invokeWithTarget:]
Frameworks/UIKit.framework/UIKit:0-[UIThreadSafeNode forwardInvocation:]
Frameworks/CoreFoundation.framework/CoreFoundation:0___forwarding___
Frameworks/CoreFoundation.framework/CoreFoundation:0__forwarding_prep_0___
Frameworks/UIKit.framework/UIKit:0-[UIKeyboardImpl _handleWebKeyEvent:withEventType:withInputString:withInputStringIgnoringModifiers:]
Frameworks/UIKit.framework/UIKit:0__78-[UIKeyboardImpl _handleWebKeyEvent:withIndex:inInputString:executionContext:]_block_invoke
Frameworks/UIKit.framework/UIKit:0-[UIKeyboardTaskExecutionContext returnExecutionToParentWithInfo:]
Frameworks/UIKit.framework/UIKit:0-[UIKeyboardTaskExecutionContext returnExecutionToParentWithInfo:]
Frameworks/UIKit.framework/UIKit:0-[UIKeyboardTaskQueue continueExecutionOnMainThread]
Frameworks/Foundation.framework/Foundation:0__NSThreadPerformPerform
Frameworks/CoreFoundation.framework/CoreFoundation:0__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
Frameworks/CoreFoundation.framework/CoreFoundation:0__CFRunLoopDoSources0
Frameworks/CoreFoundation.framework/CoreFoundation:0__CFRunLoopRun
Frameworks/CoreFoundation.framework/CoreFoundation:0CFRunLoopRunSpecific
PrivateFrameworks/GraphicsServices.framework/GraphicsServices:0GSEventRunModal
Frameworks/UIKit.framework/UIKit:0UIApplicationMain
MyApp:0mh_execute_header
/usr/lib/system/libdyld.dylib:0<redacted>
I really am not sure as to why is this crash happening.
TIA!
I was able to get this crash fixed by doing the following:
Put a Javascript callback when the keyboard is dismissed
Fetch the callback in
func webView(webView: UIWebView, shouldStartLoadWithRequest request: NSURLRequest, navigationType: UIWebViewNavigationType) -> Bool
Set the content offset of WebView's ScrollView:
webView.scrollView.setContentOffset(CGPointMake(0, 0), animated: false)
I had a bunch of WebViews inside a ScrollView. I know this is not ideal, but I had to go ahead with this.
When the keyboard is dismissed, the WebView tries to scroll to a position which does not exist and cause the app to crash.
So by doing the callback method, I scroll the WebView to the top, once the keyboard is dismissed.
I developed a DataMatrix Reader for Android with ZXING, and works fine, now I'm working in the version of iOS, but I have this errors when I want to use the library inside my project:
iOS SDK 8.1 and Library
ZXING: https://github.com/TheLevelUp/ZXingObjC
I use the COCOAPODS:
platform :ios, '7.0'
pod 'ZXingObjC', '~> 3.0'
I implemented the library in my project with Cocoapods, now I want to use in my App like this:
#import "ViewController.h"
#import "ZXingObjC.h"
#interface ViewController ()
#end
#implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (IBAction)scanBarcode:(id)sender {
CGImageRef imageToDecode; // Given a CGImage in which we are looking for barcodes
ZXLuminanceSource *source = [[[ZXCGImageLuminanceSource alloc] initWithCGImage:imageToDecode] autorelease];
ZXBinaryBitmap *bitmap = [ZXBinaryBitmap binaryBitmapWithBinarizer:[ZXHybridBinarizer binarizerWithSource:source]];
NSError *error = nil;
// There are a number of hints we can give to the reader, including
// possible formats, allowed lengths, and the string encoding.
ZXDecodeHints *hints = [ZXDecodeHints hints];
ZXMultiFormatReader *reader = [ZXMultiFormatReader reader];
ZXResult *result = [reader decode:bitmap
hints:hints
error:&error];
if (result) {
// The coded result as a string. The raw data can be accessed with
// result.rawBytes and result.length.
NSString *contents = result.text;
// The barcode format, such as a QR code or UPC-A
ZXBarcodeFormat format = result.barcodeFormat;
} else {
// Use error to determine why we didn't get a result, such as a barcode
// not being found, an invalid checksum, or a format inconsistency.
}
}
#end
but I have this error:
DataMatrixReader/ViewController.m:32:99: ARC forbids explicit message
send of 'autorelease'
DataMatrixReader/ViewController.m:32:99: 'autorelease' is unavailable:
not available in automatic reference counting mode
concretly in this line:
ZXLuminanceSource *source = [[[ZXCGImageLuminanceSource alloc]
initWithCGImage:imageToDecode] autorelease];
Help from "iamnichols"...and after the change the line:
ZXLuminanceSource *source = [[[ZXCGImageLuminanceSource alloc]
initWithCGImage:imageToDecode] autorelease];
to
ZXLuminanceSource *source = [[ZXCGImageLuminanceSource alloc]
initWithCGImage:imageToDecode];
Error:
: CGBitmapContextGetData: invalid context 0x0. This is a
serious error. This application, or a library it uses, is using an
invalid context and is thereby contributing to an overall degradation
of system stability and reliability. This notice is a courtesy: please
fix this problem. It will become a fatal error in an upcoming update.
2014-12-15 12:12:36.122 DataMatrixReader[18838:412778] * Terminating
app due to uncaught exception 'NSInvalidArgumentException', reason:
'Both dimensions must be greater than 0'
* First throw call stack: ( 0 CoreFoundation 0x0000000102626f35 exceptionPreprocess + 165 1 libobjc.A.dylib
0x00000001022bfbb7 objc_exception_throw + 45 2 DataMatrixReader
0x0000000100f09507 -[ZXBitMatrix initWithWidth:height:] + 231 3
DataMatrixReader 0x0000000100f51b7d
-[ZXGlobalHistogramBinarizer blackMatrixWithError:] + 141 4 DataMatrixReader 0x0000000100f530b0
-[ZXHybridBinarizer blackMatrixWithError:] + 816 5 DataMatrixReader 0x0000000100f068ab -[ZXBinaryBitmap blackMatrixWithError:] + 139 6
DataMatrixReader 0x0000000100fa43b2
-[ZXQRCodeReader decode:hints:error:] + 130 7 DataMatrixReader 0x0000000100f63d04 -[ZXMultiFormatReader decodeInternal:error:] + 548
8 DataMatrixReader 0x0000000100f62ade
-[ZXMultiFormatReader decode:hints:error:] + 142 9 DataMatrixReader 0x0000000100ef1df2 -[ViewController scanBarcode:] + 322 10 UIKit
0x0000000102a148be -[UIApplication sendAction:to:from:forEvent:] + 75
11 UIKit 0x0000000102b1b410
-[UIControl _sendActionsForEvents:withEvent:] + 467 12 UIKit 0x0000000102b1a7df -[UIControl touchesEnded:withEvent:] + 522 13
UIKit 0x0000000102a5a308 -[UIWindow
_sendTouchesForEvent:] + 735 14 UIKit 0x0000000102a5ac33 -[UIWindow sendEvent:] + 683 15 UIKit
0x0000000102a279b1 -[UIApplication sendEvent:] + 246 16 UIKit
0x0000000102a34a7d _UIApplicationHandleEventFromQueueEvent + 17370 17
UIKit 0x0000000102a10103
_UIApplicationHandleEventQueue + 1961 18 CoreFoundation 0x000000010255c551
__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17 19 CoreFoundation 0x000000010255241d
__CFRunLoopDoSources0 + 269 20 CoreFoundation 0x0000000102551a54 __CFRunLoopRun + 868 21 CoreFoundation
0x0000000102551486 CFRunLoopRunSpecific + 470 22 GraphicsServices
0x0000000104bc09f0 GSEventRunModal + 161 23 UIKit
0x0000000102a13420 UIApplicationMain + 1282 24 DataMatrixReader
0x0000000100ef2343 main + 115 25 libdyld.dylib
0x00000001058a3145 start + 1 ) libc++abi.dylib: terminating with
uncaught exception of type NSException (lldb)
Now the question is somebody tried to integrate the ZxingObjC in iOS 8.1?
I think your project is using ARC but ZXING library isn't. In that case go to path 'Target -> Build Phases -> Compile Sources' in ZXING library. Double click on each .m file and enter '-fno-objc-arc' in popped dialog box. In this way those files will be excluded from ARC
If you project is using ARC (Automatic Reference Counting) then you don't need to make autorelease calls as it is done for you.
Change
ZXLuminanceSource *source = [[[ZXCGImageLuminanceSource alloc] initWithCGImage:imageToDecode] autorelease];
to
ZXLuminanceSource *source = [[ZXCGImageLuminanceSource alloc] initWithCGImage:imageToDecode];
Further information about ARC can be found on the iOS Developer Library
This works perfectly for me:
Getting Started in the readme.md didn’t work so I had to do the following steps to make it work.
copy the whole folders into your working project’s sub-folder.
and drag/add ZXingObjC.xcodeproj file to “<your working project>”.
make sure tick create folder references for any added folders option when prompted.
then, go to your project’s Target > Build Phases
under Target Dependencies, add ZXingObjC-iOS (ZXingObjC)
under Link Binary With Libraries, add libZXingObjC-iOS.a
under the same category, add the following 6 frameworks
AVFoundation.framework
CoreGraphics.framework
CoreMedia.framework
CoreVideo.framework
ImageIO.framework
QuartzCore.framework
Source in: http://sagage.com/?p=55
My test in a direct device Iphone 4s were good, perhaps is not the best device to test that, Iphone 4s has not a "AutoFocus" feature, very important for work with this barcodes.
hope this saves your day.
I'm new to ios development and to stackoverflow. I did try searching both stackoverflow and google before posting.
I built a simple little app, originally just left it an iphone only app, but decided to make it universal in the end. I, stupidly, was messing around when i was getting to know xcode 4 and switched it to universal and then back again so i had to recopy the project and do it again. This time i started it with a universal app. (Not when i created it but after i went to project and selected it there) It created the ipad folder and mainwindow-ipad.xib file but was empty of course since i didn't do anything yet. I had it set up as a tabbed based app so my iphone version had firstview and secondview nib files also, but the ipad version didn't. I set it all up in iphone version first and it worked fine. I then went and laid down the ipad version (i did eliminate the second tab from mainwindow-ipad because i didn't need it)
i then went and created a new nib file and placed it in the ipad folder along with "main-ipad.h" and "main-ipad.m". I copied my code and connected everything and it runs fine on ipad simulator but now when i try and run iphone simulator i get "SIGABRT error. I took a screen shot of it. I don't fully understand objective-c so i was hoping someone can help me? I can post any code or whatever you might need to help me with this error so just ask.
Appreciate any help and suggestions you may have!
Thanks!
[Okay i would have posted image but I can't since I'm a new user, instead i posted the line highlighted and the output from xcode]
Code for file with error:
int main(int argc, char *argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, nil); //ERROR IS ON THIS LINE <-----
[pool release];
return retVal;
}
[OUTPUT]
2011-06-18 17:32:43.980 Price Assist[445:207] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIViewController 0x4e09cc0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key finallabel.'
*** Call stack at first throw:
(
0 CoreFoundation 0x00dc35a9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x00f17313 objc_exception_throw + 44
2 CoreFoundation 0x00dc34e1 -[NSException raise] + 17
3 Foundation 0x00795677 _NSSetUsingKeyValueSetter + 135
4 Foundation 0x007955e5 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 285
5 UIKit 0x0021130c -[UIRuntimeOutletConnection connect] + 112
6 CoreFoundation 0x00d398cf -[NSArray makeObjectsPerformSelector:] + 239
7 UIKit 0x0020fd23 -[UINib instantiateWithOwner:options:] + 1041
8 UIKit 0x00211ab7 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 168
9 UIKit 0x000c7628 -[UIViewController _loadViewFromNibNamed:bundle:] + 70
10 UIKit 0x000c5134 -[UIViewController loadView] + 120
11 UIKit 0x000c500e -[UIViewController view] + 56
12 UIKit 0x00038d42 -[UIWindow addRootViewControllerViewIfPossible] + 51
13 Foundation 0x007955e5 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 285
14 UIKit 0x00048ff6 -[UIView(CALayerDelegate) setValue:forKey:] + 173
15 UIKit 0x0021130c -[UIRuntimeOutletConnection connect] + 112
16 CoreFoundation 0x00d398cf -[NSArray makeObjectsPerformSelector:] + 239
17 UIKit 0x0020fd23 -[UINib instantiateWithOwner:options:] + 1041
18 UIKit 0x00211ab7 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 168
19 UIKit 0x0001717a -[UIApplication _loadMainNibFile] + 172
20 UIKit 0x00017cf4 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 291
21 UIKit 0x00022617 -[UIApplication handleEvent:withNewEvent:] + 1533
22 UIKit 0x0001aabf -[UIApplication sendEvent:] + 71
23 UIKit 0x0001ff2e _UIApplicationHandleEvent + 7576
24 GraphicsServices 0x00ffc992 PurpleEventCallback + 1550
25 CoreFoundation 0x00da4944 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
26 CoreFoundation 0x00d04cf7 __CFRunLoopDoSource1 + 215
27 CoreFoundation 0x00d01f83 __CFRunLoopRun + 979
28 CoreFoundation 0x00d01840 CFRunLoopRunSpecific + 208
29 CoreFoundation 0x00d01761 CFRunLoopRunInMode + 97
30 UIKit 0x000177d2 -[UIApplication _run] + 623
31 UIKit 0x00023c93 UIApplicationMain + 1160
32 Price Assist 0x000029a9 main + 121
33 Price Assist 0x00002925 start + 53
)
terminate called after throwing an instance of 'NSException'
iPhone FirstView nib file .h code:
#interface FirstViewController : UIViewController {
IBOutlet UITextField *dollarinput;
IBOutlet UITextField *centsinput;
IBOutlet UIButton *combinevalue;
IBOutlet UITextField *percentoffinput;
IBOutlet UILabel *discountlabel;
IBOutlet UILabel *finallabel;
}
- (IBAction)calculate:(id)sender;
- (IBAction)backgroundTouched:(id)sender;
- (IBAction)autonext:(id)sender;
iPhone FirstView nib file .m code:
//
// FirstViewController.m
// Price Assist
//
// Created by Dustin Schreiber on 6/15/11.
// Copyright 2011 TheTechSphere.com. All rights reserved.
//
#import "FirstViewController.h"
#implementation FirstViewController
/*
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad
{
[super viewDidLoad];
}
*/
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
- (void)didReceiveMemoryWarning
{
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
// Release any cached data, images, etc. that aren't in use.
}
- (void)viewDidUnload
{
[percentoffinput release];
percentoffinput = nil;
[discountlabel release];
discountlabel = nil;
[finallabel release];
finallabel = nil;
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
- (void)dealloc
{
[percentoffinput release];
[discountlabel release];
[finallabel release];
[super dealloc];
}
- (IBAction)calculate:(id)sender {
if ([centsinput.text length] == 0){
centsinput.text = #"00";
}
if ([dollarinput.text length] == 0){
dollarinput.text = #"00";
}
if ([percentoffinput.text length] == 0){
percentoffinput.text = #"00";
}
double cDollars = [dollarinput.text doubleValue];
double cCents = [centsinput.text doubleValue];
double percentoff = [percentoffinput.text doubleValue] / 100;
NSString *ccDollars = [[NSNumber numberWithFloat:cDollars] stringValue];
NSString *ccCents = [[NSNumber numberWithFloat:cCents] stringValue];
NSString *placeholder = [NSString stringWithFormat:#"%#.%#", ccDollars, ccCents];
double combined = [placeholder doubleValue];
double discount = combined * percentoff;
NSString *discountholder2 =[NSString stringWithFormat:#"%.2f", discount];
discountlabel.text = discountholder2;
double newprice = (combined - discount);
NSString *str = [NSString stringWithFormat:#"%.2f", newprice];
finallabel.text = str;
dollarinput.text = ccDollars;
centsinput.text = ccCents;
percentoffinput.text = [[NSNumber numberWithFloat:percentoff] stringValue];
}
-(IBAction)backgroundTouched:(id)sender
{
[dollarinput resignFirstResponder];
[centsinput resignFirstResponder];
[percentoffinput resignFirstResponder];
}
- (IBAction)autonext:(id)sender {
if ([centsinput.text length ] >= 2) {
if ([centsinput.text length] > 2) {
centsinput.text = #"";
} else {
//next field
}
}
}
#end
Thanks again! If anyone has any suggestions for my code i'd love to here them! Like I said, I'm new to it and thats the only way i know to do this.
------------> If anyone wants, I'll upload the entire project folder. Just ask. Thank you guys for all the help. i'm a n00b with xcode so i haven't got it all down yet.
Project Zipped
Post some code where you use finallabel and try to debug your app so you can tell me the line just before the app crashes.
Option 2:
Try to set a BreakPoint in malloc_error_break so we can have more info about the error.
In XCode go to Run -> Show -> BreakPoints (or just cmd + option + B). Then double click to add a new symbol (symbolic breakpoint) and type in malloc_error_break then press enter.
Now run your app and paste your console text.
UPDATE If you need help http://developer.apple.com/library/mac/#recipes/xcode_help-breakpoint_navigator/articles/adding_a_symbolic_breakpoint.html
Check your connections inside your InterfaceBuilder, you may have it wrong with fianllabel.
Also check your Custom Class -> Class in your iphone XIB in your InterfaseBuilder
UPDATE
Go to Product -> Clean. Then Run.
The line UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); just means that an exception was thrown during the running of your program. This could range from a memory problem, to a simple runtime error. Look in the target debugger console; it will tell you where the error occurred.
Open "iOS Simulator" Menu in the upper left->Reset Content and Settings. Then quit the iOS simulator and Xcode, and then restart your computer. This will get rid of the other instance of the process.
This May work it's work for me...........
The problem is with your XIB file. This error generally occurs when your finalLabel is incorrectly hooked up or doesn't exist anymore. Check your connections in the Interface Builder once.
I also had this error. After spending so much time, I found how to fix it. First of all go the console and see where is the error (mine was related to storyboards and its code) The way I fixed my error was by going in story board. Below the iPhone screen, there will be small yellow button. Right click on it and you will see that is causing error. Delete(x) it if there is yellow error sign.
If this does not fix your error then try to make new project and then replace its blank files with old files of your old project. I had same error in very beginning and by doing this program run without any error.
Other people suggests by restarting your laptop and running it again, reseting the iOS simulator, or changing iOS debugger (however this does not work in latest x code since there is only one debugger)
Hope this helps