I\'m looking to be able to have the debugger break when it reaches a particular string match. As an example, I might have something like this:
Foo myObj = [s
At times when working with Frameworks (debug builds) and need to put a breakpoint in certain file/location that is hard to navigate or isn't exposed publically in framework under development. One option is to write a helper class to trigger conditional breakpoints & make step-in/step-out easier.
- (void)invokeFrameworkMethod {
...
[DebugConditionalBreakPointHelper breakPointCondition:YES comment:@"from invokeFrameworkMethod."];
...
}
Header declaration in framework under development.
#import
@interface DebugConditionalBreakPointHelper : NSObject
+ (void)breakPointCondition:(BOOL)enabled comment:(NSString *)comment;
@end
And implementation file:
#import "DebugConditionalBreakPointHelper.h"
@implementation DebugConditionalBreakPointHelper
+ (void)breakPointCondition:(BOOL)enabled comment:(NSString *)comment {
if (enabled)
{
NSLog(@"Triggerred Conditional Break Point. Comment: %@");
}
}
@end