Permalink
Browse files

Added explicit assertion message about -ObjC linker flag

Detect a common app build problem: TDRouter now checks whether its handlers have been dead-stripped and if so triggers an assertion failure warning about lack of -ObjC linker flag.
  • Loading branch information...
snej committed Jan 9, 2012
1 parent 19014f0 commit 62caeab27be489d8320fcd8ceba96fa86366e52c
Showing with 2 additions and 0 deletions.
  1. +2 −0 Source/TDRouter.m
View
@@ -287,6 +287,8 @@ - (void) start {
if (!sel || ![self respondsToSelector: sel]) {
Log(@"TDRouter: unknown request type: %@ %@ (mapped to %@)",
_request.HTTPMethod, _request.URL.path, message);
+ Assert([self respondsToSelector: @selector(do_GETRoot)],
+ @"TDRouter(Handlers) is missing -- app may be linked without -ObjC linker flag.");
sel = @selector(do_UNKNOWN);
}
TDStatus status = (TDStatus) objc_msgSend(self, sel, _db, docID, attachmentName);

0 comments on commit 62caeab

Please sign in to comment.