You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are building the Unit-Tests as a static library and link this into test
project.
The app will crash because GTMIPhoneUnitTestDelegate is not present.
----
2009-05-25 18:59:22.633 RABSQLite[23586:10b] *** Assertion failure in
UIApplicationMain(),
/SourceCache/UIKit/UIKit-738/UIApplication.m:1084
2009-05-25 18:59:22.634 RABSQLite[23586:10b] *** Terminating app due to
uncaught
exception 'NSInternalInconsistencyException', reason: 'Unable to instantiate
the UIApplication
delegate instance. No class named GTMIPhoneUnitTestDelegate is loaded.'
2009-05-25 18:59:22.636 RABSQLite[23586:10b] Stack: (
2484961451,
2486152763,
2484960907,
2493939445,
816221235,
61549,
8210
)
----
The file is only referenced by name and never used, the linker strips the
delegate.
When using the delegate inside the main function this problem is solved,
----
int main(int argc, char *argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
// Ensures that the app delegate will be linked correctly.
[GTMIPhoneUnitTestDelegate description];
int retVal = UIApplicationMain(argc, argv, nil, @"GTMIPhoneUnitTestDelegate");
[pool release];
return retVal;
}
---
This little change will have no negative effects and helps to use the
Units-Tests as a static
library.
Max
Original issue reported on code.google.com by mcz...@gmail.com on 25 May 2009 at 5:04
The linker doesn't pull over objective c classes/categories, by default, you
need to use -ObjC when linking in a
static library of Objective C.
http://developer.apple.com/qa/qa2006/qa1490.html Also covered in the man
pages for gcc.
Original comment by thoma...@gmail.com on 25 May 2009 at 5:10
Original issue reported on code.google.com by
mcz...@gmail.com
on 25 May 2009 at 5:04Attachments:
The text was updated successfully, but these errors were encountered: