Segment framework make UIAlertController to crash - ios

I follow "https://segment.com/" to implement analytics user usage on my iOS source. But when i use UIAlertController to show alert with title is #"", my app was crash! I don't know exactly why. To solve it, i must set title of alert is nil. And this is my logs:
2016-11-10 17:12:57.185 Lightning Rider Partner[24434:236155] *** Assertion failure in -[SEGAnalytics screen:properties:options:](), /Users/dungdo/Desktop/tcourier-ios/v2_driver/Pods/Analytics/Analytics/Classes/SEGAnalytics.m:323
2016-11-10 17:12:57.192 Lightning Rider Partner[24434:236155] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'screen name () must not be empty.'
*** First throw call stack:
(
0 CoreFoundation 0x000000010c1f134b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x00000001120f521e objc_exception_throw + 48
2 CoreFoundation 0x000000010c1f5442 +[NSException raise:format:arguments:] + 98
3 Foundation 0x0000000111cc1d79 -[NSAssertionHandler handleFailureInFunction:file:lineNumber:description:] + 166
4 Analytics 0x000000010bc29d37 -[SEGAnalytics screen:properties:options:] + 471
5 Analytics 0x000000010bc3fb7c -[UIViewController(SEGScreen) seg_viewDidAppear:] + 444
6 UIKit 0x000000010e50eb0c -[UIViewController _setViewAppearState:isAnimating:] + 945
7 UIKit 0x000000010e51187a __64-[UIViewController viewDidMoveToWindow:shouldAppearOrDisappear:]_block_invoke + 42
8 UIKit 0x000000010e50fb64 -[UIViewController _executeAfterAppearanceBlock] + 86
9 UIKit 0x000000010e374438 _runAfterCACommitDeferredBlocks + 653
10 UIKit 0x000000010e360f6f _cleanUpAfterCAFlushAndRunDeferredBlocks + 566
11 UIKit 0x000000010e3923da _afterCACommitHandler + 176
12 CoreFoundation 0x000000010c195e17 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
13 CoreFoundation 0x000000010c195d87 __CFRunLoopDoObservers + 391
14 CoreFoundation 0x000000010c17ab9e __CFRunLoopRun + 1198
15 CoreFoundation 0x000000010c17a494 CFRunLoopRunSpecific + 420
16 GraphicsServices 0x0000000115145a6f GSEventRunModal + 161
17 UIKit 0x000000010e367964 UIApplicationMain + 159
18 Lightning Rider Partner 0x000000010ad74c3f main + 111
19 libdyld.dylib 0x00000001128a868d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

I was getting the same issue while using the Segment framework.
I just comment the Assert statement in SDK file for empty screen. Please search line below in your whole project and comment it out.
NSCAssert1(screenTitle.length > 0, #"screen name (%#) must not be empty.", screenTitle);
You are good to go.

This seems like the error Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'screen name () must not be empty.
Make sure you already set it while creating SEGAnalytics class or something related

Related

App Crashes (Sometimes) when Home Button is Pressed

I am really confused as to why this is happening.
Since this happened randomly
Here is the stacktrace, I have not been able to figure it out.
Please help
Thanks
2015-03-30 15:12:50.817 MarcoApp[1857:23629] -[NSIBPrototypingLayoutConstraint finishedLoading]: unrecognized selector sent to instance 0x7f929ccc8cf0
2015-03-30 15:12:50.908 MarcoApp[1857:23629] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSIBPrototypingLayoutConstraint finishedLoading]: unrecognized selector sent to instance 0x7f929ccc8cf0'
*** First throw call stack:
(
0 CoreFoundation 0x000000010aa74a75 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010a333bb7 objc_exception_throw + 45
2 CoreFoundation 0x000000010aa7bd1d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x000000010a9d39dc ___forwarding___ + 988
4 CoreFoundation 0x000000010a9d3578 _CF_forwarding_prep_0 + 120
5 CoreFoundation 0x000000010aa447fc __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12
6 CoreFoundation 0x000000010a944204 _CFXNotificationPost + 2484
7 Foundation 0x0000000109e8ddf8 -[NSNotificationCenter postNotificationName:object:userInfo:] + 66
8 UIKit 0x000000010b73baa7 -[UIApplication _handleApplicationDectivationWithScene:shouldForceExit:transitionContext:completion:] + 1054
9 UIKit 0x000000010b748833 __88-[UIApplication _handleApplicationLifecycleEventWithScene:transitionContext:completion:]_block_invoke + 87
10 UIKit 0x000000010b7487cd -[UIApplication _handleApplicationLifecycleEventWithScene:transitionContext:completion:] + 349
11 UIKit 0x000000010b73345a -[UIApplication scene:didUpdateWithDiff:transitionContext:completion:] + 486
12 FrontBoardServices 0x00000001115ae243 __31-[FBSSerialQueue performAsync:]_block_invoke + 16
13 CoreFoundation 0x000000010a9a9c7c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
14 CoreFoundation 0x000000010a99f9c5 __CFRunLoopDoBlocks + 341
15 CoreFoundation 0x000000010a99f785 __CFRunLoopRun + 2389
16 CoreFoundation 0x000000010a99ebc6 CFRunLoopRunSpecific + 470
17 GraphicsServices 0x000000010e89ca58 GSEventRunModal + 161
18 UIKit 0x000000010b735580 UIApplicationMain + 1282
19 MarcoApp 0x0000000109184afe top_level_code + 78
20 MarcoApp 0x0000000109184bda main + 42
21 libdyld.dylib 0x000000010ee2b145 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
hard to tell without seeing your code but "unrecognized selector sent to instance" implies you have a method the requires a selector (name of a function) as a parameter and that methods got an invalid selector (the name of the function is wrong).
not sure but ther is any method in
- (void)applicationWillResignActive:(UIApplication *)application
which does not have selector thats why you app crash

error when adding a new xib in main interface

downloaded here this parser launched, it works, but when I want to change main interface (the default setting is MainWindow.xib, and I want to put my xib), shows the following error. I wish that I was a structure MyNewXib.xib - MainWindow.xib - RootViewController.xib, but when I add in MainInterface MyNewXib.xib get this error, how do I fix it.
2015-03-23 11:27:02.686 TetraVer 1.1[411:5899] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIApplication 0x7fa352c30c10> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key view.'
*** First throw call stack:
(
0 CoreFoundation 0x0000000110e1ba75 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010fad9bb7 objc_exception_throw + 45
2 CoreFoundation 0x0000000110e1b6b9 -[NSException raise] + 9
3 Foundation 0x000000010f42fd43 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 259
4 CoreFoundation 0x0000000110d655e0 -[NSArray makeObjectsPerformSelector:] + 224
5 UIKit 0x000000010e3f54ed -[UINib instantiateWithOwner:options:] + 1506
6 UIKit 0x000000010e3f6f92 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 160
7 UIKit 0x000000010e12dc71 -[UIApplication _loadMainNibFileNamed:bundle:] + 46
8 UIKit 0x000000010e12cd2b -[UIApplication _runWithMainScene:transitionContext:completion:] + 1074
9 UIKit 0x000000010e12bd35 -[UIApplication workspaceDidEndTransaction:] + 179
10 FrontBoardServices 0x000000010fe84243 __31-[FBSSerialQueue performAsync:]_block_invoke + 16
11 CoreFoundation 0x0000000110d50c7c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
12 CoreFoundation 0x0000000110d469c5 __CFRunLoopDoBlocks + 341
13 CoreFoundation 0x0000000110d46785 __CFRunLoopRun + 2389
14 CoreFoundation 0x0000000110d45bc6 CFRunLoopRunSpecific + 470
15 UIKit 0x000000010e12b7a2 -[UIApplication _run] + 413
16 UIKit 0x000000010e12e580 UIApplicationMain + 1282
17 TetraVer 1.1 0x000000010e06c6f4 main + 68
18 libdyld.dylib 0x0000000114c7d145 start + 1
19 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Make sure you have the elements linked correctly with interface and definition (check the outlet for you xib elements). This error comes usually when you have one ore more element in xib witch definition (#property) was deleted.

Terminating with uncaught exception of type NSException on iOS 7.1

When I run my app on a iOS 8+ or later device, it runs perfectly with no errors but when I run it on a iOS 7.1 device the app crashes with this message:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[SKLabelNode labelNodeWithText:]: unrecognized selector sent to class 0xedc5fc'
*** First throw call stack:
(
0 CoreFoundation 0x0098a1e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x004d58e5 objc_exception_throw + 44
2 CoreFoundation 0x00a270e3 +[NSObject(NSObject) doesNotRecognizeSelector:] + 275
3 CoreFoundation 0x0097a50b ___forwarding___ + 1019
4 CoreFoundation 0x0097a0ee _CF_forwarding_prep_0 + 14
5 Origami Game 0x0002161f -[GBAGameScene initWithSize:] + 495
6 Origami Game 0x000281b4 -[GBAMenuScene touchesBegan:withEvent:] + 500
7 SpriteKit 0x00e102bf -[SKView touchesBegan:withEvent:] + 824
8 UIKit 0x00f64c0b -[UIWindow _sendTouchesForEvent:] + 386
9 UIKit 0x00f659d1 -[UIWindow sendEvent:] + 1117
10 UIKit 0x00f375f2 -[UIApplication sendEvent:] + 242
11 UIKit 0x00f21353 _UIApplicationHandleEventQueue + 11455
12 CoreFoundation 0x0091377f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
13 CoreFoundation 0x0091310b __CFRunLoopDoSources0 + 235
14 CoreFoundation 0x009301ae __CFRunLoopRun + 910
15 CoreFoundation 0x0092f9d3 CFRunLoopRunSpecific + 467
16 CoreFoundation 0x0092f7eb CFRunLoopRunInMode + 123
17 GraphicsServices 0x025245ee GSEventRunModal + 192
18 GraphicsServices 0x0252442b GSEventRun + 104
19 UIKit 0x00f23f9b UIApplicationMain + 1225
20 Origami Game 0x00026d5d main + 141
21 libdyld.dylib 0x02a756d9 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
I don't know what's happening, my app uses the Sprite Kit framework and I'm not using the storyboards, just code.
The init method initWithText: which is called by the class method [SKLabelNode labelNodeWithText:] was only added in iOS 8 so you cannot call this method in iOS 7. As a workaround use:
SKLabelNode *lbl=[SKLabelNode labelNodeWithFontNamed: "Arial"];
lbl.text="hello world";
To find which methods are available on which OS look at the docs.
(sorry if my obj-c isn't right or the method has a different name)

Xcode/IOS debugging

I am a total newbie with objective C and IOS programming trying to follow along with a tutorial on the Apple Website.
I got to the point in the Apple tutorial where you add an unwind segue to the Add to-do page.
https://developer.apple.com/library/ios/referencelibrary/GettingStarted/RoadMapiOS/SecondTutorial.html#//apple_ref/doc/uid/TP40011343-CH8-SW1
I successfully added unwind segues to both the Cancel and Done buttons.
However, when I compiled the program, while it compiles, it no longer lets me click on + to get to the add to-do page.
When the simulator initially loads, it is fine. But when I click on +, Xcode appears in front of the simulator and in the debugger it says what is below.
Note I have no experience in debugging. What appears in editor is main.m and the following is in right side of debug section at bottom:
2014-12-03 13:28:54.854 single-nocore[20692:1523451] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UITableViewController loadView] loaded the "vXZ-lx-hvc-view-kh9-bI-dsS" nib but didn't get a UITableView.'
*** First throw call stack:
(
0 CoreFoundation 0x0000000102eabf35 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000101265bb7 objc_exception_throw + 45
2 CoreFoundation 0x0000000102eabe6d +[NSException raise:format:] + 205
3 UIKit 0x0000000101785415 -[UITableViewController loadView] + 249
4 UIKit 0x00000001015c87f9 -[UIViewController loadViewIfRequired] + 75
5 UIKit 0x00000001015c8c8e -[UIViewController view] + 27
6 UIKit 0x0000000101600d3b -[UINavigationController preferredContentSize] + 149
7 UIKit 0x00000001015a8ec2 -[UIPresentationController preferredContentSizeDidChangeForChildContentContainer:] + 101
8 UIKit 0x00000001015a6b0d __56-[UIPresentationController runTransitionForCurrentState]_block_invoke + 108
9 UIKit 0x00000001014c6331 _applyBlockToCFArrayCopiedToStack + 314
10 UIKit 0x00000001014c61ab _afterCACommitHandler + 516
11 CoreFoundation 0x0000000102de0dc7 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
12 CoreFoundation 0x0000000102de0d20 __CFRunLoopDoObservers + 368
13 CoreFoundation 0x0000000102dd6b53 __CFRunLoopRun + 1123
14 CoreFoundation 0x0000000102dd6486 CFRunLoopRunSpecific + 470
15 GraphicsServices 0x0000000104bae9f0 GSEventRunModal + 161
16 UIKit 0x00000001014a3420 UIApplicationMain + 1282
17 single-nocore 0x0000000100d39b23 main + 115
18 libdyld.dylib 0x0000000103b5c145 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
Thanks in advance for any suggestions.

GameCenter Leaderboard in SpriteKit causing error

I finished my game in Sprite Kit and am now trying to store the highscore in GameCenter's Leaderboards. I followed some tutorials that worked great for none-spritekit-projects. Steps to my error:
I debug my app without any errors, some warnings but they do no harm.
App runs great, and my starting SKActions work flawless.
I log in to GameCenter succesfully.
When I touch the screen it freezes and gives me a "Missed Method" log error and "Thread 1:EXC_BAD_ACCESS (code=1, address=0x80000012)". Whenever I delete the line of code causing the BAD_ACESS error it pops up some other place in my code.
My Log:
2014-04-21 19:51:26.893 Sharky[3417:60b] Missed Method
2014-04-21 19:51:27.683 Sharky[3417:60b] -[NSMethodSignature copyWithZone:]: unrecognized selector sent to instance 0xacbdc20
2014-04-21 19:51:27.685 Sharky[3417:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSMethodSignature copyWithZone:]: unrecognized selector sent to instance 0xacbdc20'
*** First throw call stack:
(
0 CoreFoundation 0x0009c1e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x019978e5 objc_exception_throw + 44
2 CoreFoundation 0x00139243 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
3 CoreFoundation 0x0008c50b ___forwarding___ + 1019
4 CoreFoundation 0x0008c0ee _CF_forwarding_prep_0 + 14
5 libobjc.A.dylib 0x019a9bcd -[NSObject copy] + 41
6 SpriteKit 0x01481f4c -[SKNode runAction:] + 55
7 Sharky 0x0000595c -[MyScene touchesBegan:withEvent:] + 476
8 SpriteKit 0x014702bf -[SKView touchesBegan:withEvent:] + 824
9 UIKit 0x00576c0b -[UIWindow _sendTouchesForEvent:] + 386
10 UIKit 0x005779d1 -[UIWindow sendEvent:] + 1117
11 UIKit 0x005495f2 -[UIApplication sendEvent:] + 242
12 UIKit 0x00533353 _UIApplicationHandleEventQueue + 11455
13 CoreFoundation 0x0002577f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
14 CoreFoundation 0x0002510b __CFRunLoopDoSources0 + 235
15 CoreFoundation 0x000421ae __CFRunLoopRun + 910
16 CoreFoundation 0x000419d3 CFRunLoopRunSpecific + 467
17 CoreFoundation 0x000417eb CFRunLoopRunInMode + 123
18 GraphicsServices 0x03a7f5ee GSEventRunModal + 192
19 GraphicsServices 0x03a7f42b GSEventRun + 104
20 UIKit 0x00535f9b UIApplicationMain + 1225
21 Sharky 0x0000a472 main + 130
22 libdyld.dylib 0x023e4701 start + 1
23 ??? 0x00000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
Does anyone have any clue whats going on? Or does someone have a step-by-step tutorial on how to integrate GameCenter Leaderboards into a sprite kit project?

Resources