An error About Kiwi unit test - ios

I am learning unit test.I am going to use Kiwi framework.I wrote a simple test code using Kiwi blow:
#import <Kiwi/Kiwi.h>
SPEC_BEGIN(SimpleStringSpec)
describe(#"SimpleString", ^{
context(#"when assigned to 'Hello world'", ^{
NSString *greeting = #"Hello world";
it(#"should exist", ^{
[[greeting shouldNot] beNil];
});
it(#"should equal to 'Hello world'", ^{
[[greeting should] equal:#"Hello world"];
});
});
});
SPEC_END
When testing the code, Project will crash with an error blow:
12:26:50.842 XCTest_Demo[8053:93923] _XCT_testBundleReadyWithProtocolVersion:minimumVersion: reply received
12:26:50.852 XCTest_Demo[8053:93923] _IDE_startExecutingTestPlanWithProtocolVersion:16
2016-05-25 12:26:50.856 XCTest_Demo[8053:93891] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSInvocation _invocationWithMethodSignature:frame:]: method signature argument cannot be nil'
*** First throw call stack:
(
0 CoreFoundation 0x0000000109a4dd85 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000107949deb objc_exception_throw + 48
2 CoreFoundation 0x000000010990d71d +[NSInvocation _invocationWithMethodSignature:frame:] + 333
3 XCTest 0x0000000111b38ea9 -[XCTestCase initWithSelector:] + 167
4 XCTest 0x0000000111b38f08 +[XCTestCase testCaseWithSelector:] + 43
5 XCTest 0x0000000111b374cb +[XCTestSuite testSuiteForTestCaseWithName:] + 344
6 XCTest 0x0000000111b38181 -[XCTestSuite _initWithTestConfiguration:] + 508
7 XCTest 0x0000000111b38674 +[XCTestSuite testSuiteForTestConfiguration:] + 50
8 XCTest 0x0000000111b24979 -[XCTestDriver _runSuite] + 233
9 XCTest 0x0000000111b257d1 -[XCTestDriver _checkForTestManager] + 259
10 XCTest 0x0000000111b6fa9a _XCTestMain + 628
11 CoreFoundation 0x00000001099732ec __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
12 CoreFoundation 0x0000000109968f75 __CFRunLoopDoBlocks + 341
13 CoreFoundation 0x00000001099686d2 __CFRunLoopRun + 850
14 CoreFoundation 0x00000001099680f8 CFRunLoopRunSpecific + 488
15 GraphicsServices 0x000000010b74bad2 GSEventRunModal + 161
16 UIKit 0x0000000107daef09 UIApplicationMain + 171
17 XCTest_Demo 0x0000000107456c5f main + 111
18 libdyld.dylib 0x000000010a6a592d start + 1
19 ??? 0x0000000000000005 0x0 + 5
)
libc++abi.dylib: terminating with uncaught exception of type NSException
What's wrong?

Related

Unity Firebase Xcode Messaging. First game start error

Firebase Unity SDK v.3.0.3
Unity 5.4.2f2
Xcode 8.3
I create a iOS build. When first start the game, you receive the following error.
2017-06-05 15:51:32.503767+0700 tacticool[1549:942648] -[UIApplication messaging:didRefreshRegistrationToken:]: unrecognized selector sent to instance 0x14f79ce0
2017-06-05 15:51:32.589532+0700 tacticool[1549:942648] Uncaught exception: NSInvalidArgumentException: -[UIApplication messaging:didRefreshRegistrationToken:]: unrecognized selector sent to instance 0x14f79ce0
(
0 CoreFoundation 0x1c2c3b55 <redacted> + 152
1 libobjc.A.dylib 0x1b54b067 objc_exception_throw + 38
2 CoreFoundation 0x1c2c8fd1 <redacted> + 0
3 CoreFoundation 0x1c2c70c3 <redacted> + 696
4 CoreFoundation 0x1c1efdc8 _CF_forwarding_prep_0 + 24
5 tacticool 0x00a66b4b -[FIRMessaging defaultInstanceIDTokenWasRefreshed:] + 162
6 CoreFoundation 0x1c26fdb9 <redacted> + 10
7 CoreFoundation 0x1c26f6f9 <redacted> + 382
8 CoreFoundation 0x1c26f4e1 <redacted> + 40
9 CoreFoundation 0x1c2ca309 <redacted> + 1242
10 CoreFoundation 0x1c1d30f5 _CFXNotificationPost + 540
11 Foundation 0x1cb70bab <redacted> + 450
12 CoreFoundation 0x1c27f803 <redacted> + 20
13 CoreFoundation 0x1c27da55 <redacted> + 282
14 CoreFoundation 0x1c27df2d <redacted> + 1124
15 CoreFoundation 0x1c1d11af CFRunLoopRunSpecific + 470
16 CoreFoundation 0x1c1d0fd1 CFRunLoopRunInMode + 104
17 GraphicsServices 0x1d97bb41 GSEventRunModal + 80
18 UIKit 0x21552e13 UIApplicationMain + 150
19 tacticool 0x000f0b9b main + 202
20 libdyld.dylib 0x1b9be4eb <redacted> + 2
)
2017-06-05 15:51:32.591642+0700 tacticool[1549:942648] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIApplication messaging:didRefreshRegistrationToken:]: unrecognized selector sent to instance 0x14f79ce0'
*** First throw call stack:
(0x1c2c3b3d 0x1b54b067 0x1c2c8fd1 0x1c2c70c3 0x1c1efdc8 0xa66b4b 0x1c26fdb9 0x1c26f6f9 0x1c26f4e1 0x1c2ca309 0x1c1d30f5 0x1cb70bab 0x1c27f803 0x1c27da55 0x1c27df2d 0x1c1d11af 0x1c1d0fd1 0x1d97bb41 0x21552e13 0xf0b9b 0x1b9be4eb)
libc++abi.dylib: terminating with uncaught exception of type NSException
Do I miss something in XCode? Or have something to check in Unity?

Error with Braintree UI BTDropInViewController

this is my first time implementing Braintree and I've been following the documentation clearly. I've integrated it with CocoaPods but I have an issue in BTDropInViewController. It throws an error
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[UIColor bt_colorWithBytesR:G:B:]: unrecognized selector sent to class 0x10fd17948
In this line
BTDropInViewController *dropInViewController = [[BTDropInViewController alloc]
initWithAPIClient:self.braintreeClient];
I've tried to import these 3 headers just to be sure, but still the same result
#import <Braintree/UIColor+BTUI.h>
#import "BraintreeUI.h"
#import <Braintree/BTUI.h>
And here is the full error
2016-11-16 15:56:35.418 Projc[43766:2236752] +[UIColor bt_colorWithBytesR:G:B:]: unrecognized selector sent to class 0x10fd17948
2016-11-16 15:56:35.504 Projc[43766:2236752] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[UIColor bt_colorWithBytesR:G:B:]: unrecognized selector sent to class 0x10fd17948'
*** First throw call stack:
(
0 CoreFoundation 0x00000001116aaf45 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000110998deb objc_exception_throw + 48
2 CoreFoundation 0x00000001116b346d +[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x0000000111600eea ___forwarding___ + 970
4 CoreFoundation 0x0000000111600a98 _CF_forwarding_prep_0 + 120
5 Projc 0x000000010ccb95b0 -[BTUI borderColor] + 64
6 Projc 0x000000010cc9abf4 -[BTDropInContentView initWithFrame:] + 964
7 UIKit 0x000000010f0abe3d -[UIView init] + 62
8 Projc 0x000000010ccc329e -[BTUIThemedView init] + 62
9 Projc 0x000000010cca5fed -[BTDropInViewController initWithAPIClient:] + 285
10 Projc 0x000000010cb0998b __51-[RegisterController basicPlanClicked]_block_invoke + 411
11 Projc 0x000000010cac1a66 __59-[downloadJson:endPointString:WithHandler:]_block_invoke + 214
12 CFNetwork 0x000000010d4f5b3d __75-[__NSURLSessionLocal taskForClass:request:uploadFile:bodyData:completion:]_block_invoke + 19
13 CFNetwork 0x000000010d507fb6 __49-[__NSCFLocalSessionTask _task_onqueue_didFinish]_block_invoke + 302
14 Foundation 0x000000011060c3b8 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 7
15 Foundation 0x00000001105480e5 -[NSBlockOperation main] + 101
16 Foundation 0x000000011052b036 -[__NSOperationInternal _start:] + 646
17 Foundation 0x000000011052ac47 __NSOQSchedule_f + 194
18 libdispatch.dylib 0x0000000111e0649b _dispatch_client_callout + 8
19 libdispatch.dylib 0x0000000111dee2af _dispatch_main_queue_callback_4CF + 1738
20 CoreFoundation 0x000000011160b2e9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
21 CoreFoundation 0x00000001115cc8a9 __CFRunLoopRun + 2073
22 CoreFoundation 0x00000001115cbe08 CFRunLoopRunSpecific + 488
23 GraphicsServices 0x0000000112291ad2 GSEventRunModal + 161
24 UIKit 0x000000010f01f30d UIApplicationMain + 171
25 Projc 0x000000010cba86bf main + 111
26 libdyld.dylib 0x0000000111e3b92d start + 1
27 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)

Can't log my t setAccessToken

I want to make a new object from string access_token.
I've made a Token:NSObject (.h + .m) and I'm trying to setAccessToken and show it in the NSLog. This is the code in my LoginViewController.m:
NSString *token = responseObject[#"access_token"];
Token *t = [[Token alloc]init];
[t setAccessToken:token];
NSLog(t);
And this is the error i get:
Create[29485:770358] -[Token _fastCStringContents:]: unrecognized
selector sent to instance 0x7f8e815d0780
Create[29485:770358] * Terminating app due to uncaught exception
'NSInvalidArgumentException', reason: '-[Token _fastCStringContents:]:
unrecognized selector sent to instance 0x7f8e815d0780'
* First throw call stack: ( 0 CoreFoundation 0x000000010149ff45 exceptionPreprocess + 165 1 libobjc.A.dylib
0x0000000100f19deb objc_exception_throw + 48 2 CoreFoundation
0x00000001014a856d -[NSObject(NSObject) doesNotRecognizeSelector:] +
205 3 CoreFoundation 0x00000001013f5eea
___forwarding_ + 970 4 CoreFoundation 0x00000001013f5a98 _CF_forwarding_prep_0 + 120 5
libsystem_trace.dylib 0x00000001036e8327
os_log_shim_with_CFString + 120 6 CoreFoundation
0x000000010148ef24 _CFLogvEx3 + 132 7 Foundation
0x0000000100b9489e _NSLogv + 117 8 Foundation
0x0000000100ae40f2 NSLog + 152 9 Create
0x00000001004d665b 21-[LoginVC UserLogin:]_block_invoke + 203 10
Create 0x00000001004d7f18
__64-[AFHTTPRequestOperation setCompletionBlockWithSuccess:failure:]_block_invoke49 + 40 11
libdispatch.dylib 0x00000001033fde5d
_dispatch_call_block_and_release + 12 12 libdispatch.dylib 0x000000010341e49b _dispatch_client_callout + 8 13 libdispatch.dylib
0x00000001034062af _dispatch_main_queue_callback_4CF + 1738 14
CoreFoundation 0x00000001014002e9
__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 9 15 CoreFoundation 0x00000001013c18a9 __CFRunLoopRun
+ 2073 16 CoreFoundation 0x00000001013c0e08 CFRunLoopRunSpecific + 488 17 GraphicsServices
0x00000001056dcad2 GSEventRunModal + 161 18 UIKit
0x000000010184c30d UIApplicationMain + 171 19 Create
0x00000001004d6a2f main + 111 20 libdyld.dylib
0x000000010345292d start + 1 21 ???
0x0000000000000001 0x0 + 1 ) libc++abi.dylib: terminating with
uncaught exception of type NSException
Hope somebody can help me out!
NSLog(...) function assumes the first argument is an instance of NSString. If you want to use a different object, either use:
NSLog([t description]) or a format string NSLog(#"%#", t).

Nextpeer Issue With Cocos2dx

I am using Nextpeer with cocos2dx in iOS.
I have configure Nextpeer sdk with cocos2dx successfully.
In "AppController.mm" i am using following code
[Nextpeer initializeWithProductKey:#"KEY" andDelegates:[NPDelegatesContainer containerWithNextpeerDelegate:self]];
but my code is crashed with following log
2015-09-05 17:05:06.621 Test-mobile[5474:79097] Using Nextpeer version 2.2.2, build number 28, server: https://api.nextpeer.com/v3
2015-09-05 17:05:08.250 Test-mobile[5474:79097] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'data parameter is nil'
*** First throw call stack:
(
0 CoreFoundation 0x000000010ac52c65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010a828bb7 objc_exception_throw + 45
2 CoreFoundation 0x000000010ac52b9d +[NSException raise:format:] + 205
3 Foundation 0x0000000109af37ef +[NSJSONSerialization JSONObjectWithData:options:error:] + 67
4 Test-mobile 0x00000001060a85e5 -[NPStringsService loadResourceBundleStrings] + 159
5 Test-mobile 0x00000001060a82f1 -[NPStringsService fillStringModel] + 41
6 Test-mobile 0x00000001060a7ec1 -[NPStringsService init] + 72
7 Test-mobile 0x00000001060a7e2b +[NPStringsService initializeService] + 58
8 Test-mobile 0x0000000106061b2f +[Nextpeer initializeWithProductKey:andSettings:andDelegates:] + 1150
9 Test-mobile 0x00000001060616a4 +[Nextpeer initializeWithProductKey:andDelegates:] + 50
10 Test-mobile 0x000000010605ef07 -[AppController application:didFinishLaunchingWithOptions:] + 1095
11 UIKit 0x00000001077da788 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 240
12 UIKit 0x00000001077db397 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 2540
13 UIKit 0x00000001077de1de -[UIApplication _runWithMainScene:transitionContext:completion:] + 1349
14 UIKit 0x00000001077dd0d5 -[UIApplication workspaceDidEndTransaction:] + 179
15 FrontBoardServices 0x000000010e4a05e5 __31-[FBSSerialQueue performAsync:]_block_invoke_2 + 21
16 CoreFoundation 0x000000010ab8641c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
17 CoreFoundation 0x000000010ab7c165 __CFRunLoopDoBlocks + 341
18 CoreFoundation 0x000000010ab7bf25 __CFRunLoopRun + 2389
19 CoreFoundation 0x000000010ab7b366 CFRunLoopRunSpecific + 470
20 UIKit 0x00000001077dcb42 -[UIApplication _run] + 413
21 UIKit 0x00000001077df900 UIApplicationMain + 1282
22 Test-mobile 0x000000010605f604 main + 100
23 libdyld.dylib 0x000000010b83b145 start + 1
24 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException.
Nextpeer SDK Version is 2.2.2.
Cocos2dx SDK Version is 3.7.1.
Xcode Version is 6.3.2.
How i can resolve this issue.
I have try following code
#try {
if([Nextpeer isNextpeerSupported])
{
NSLog(#"AAAAAAAAA");
[Nextpeer initializeWithProductKey:#"88b83720cf1fa8e9f2007f29e91b9dd6" andDelegates:[NPDelegatesContainer containerWithNextpeerDelegate:self]];
}
else
NSLog(#"BBBBBBBB");
}
#catch (NSException * e) {
NSLog(#"Exception: %#", e);
}
#finally {
}
but getting exception
2015-09-07 11:33:44.382 Test-mobile[2811:25650] Name: NSInvalidArgumentException
2015-09-07 11:33:44.382 Test-mobile[2811:25650] Reason: data parameter is nil

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

Resources