The error popup with the following error message comes on the screen repeatedly when application is in idle state (no user activity is performed).
Error occurred on client: (TypeError): Unable to get property 'iterator_0' of undefined or null reference.
number: -2146823281
at handleEvent_206....EF34544...cache.html
at dispatchEvent_0..EF34544...cache.html
at sucess_184 ..
..
Can anyone give some pointers to navigate to the problamatic area in the code?
The fact that you're getting it repeatedly is probably due to the fact that you're performing an action on a timer (i.e. perform repeatedly an action).
From the small snippet you've shown, I don't think there's anything we can deduce. Do you have a larger stacktrace? It is still possible the error is in your own code (trying to invoke iterator() on a null object).
I am trying to detect cell boundaries(tracking line) but error showing while clicking on progressive line on imageJ can someone please translate the error to me ?I have attached the error here
refer: printscreen is attached here
It is an IllegalArgumentException, "out of range 2". It means that when you call ImageStack.getProcessor(3), there are not 3 images/slices into your stack.
Exactly the line that generates your error is:
if (stack[n-1] instanceof byte[])
Use getSize in order to find the number of slices/images present into your stack.
I am trying to throw an error (user defined and not the netLogo runtime error ) if one button is pressed before the other.
I have three buttons " SETUP" , "CONFIGURE", " SIMULATE" . I want to throw an error if SIMULATE is clicked before CONFIGEURE.
I know there is a primitive available " user-message" as mentioned by Sir.Seth Tisue in my other question, but do not know how to include it for my situaton.
Make a global configured?. Have configure set it to true. Then in simulate, put:
if configured? != true [
user-message "You must press configure first"
stop
]
I have an All Exceptions breakpoint configured in Xcode:
Sometimes Xcode will stop on a line like:
[managedObjectContext save:&error];
with the following backtrace:
but the program continues on as if nothing happened if you click Continue.
How can I ignore these "normal" exceptions, but still have the debugger stop on exceptions in my own code?
(I understand that this happens because Core Data internally throws and catches exceptions, and that Xcode is simply honoring my request to pause the program whenever an exception is thrown. However, I want to ignore these so I can get back to debugging my own code!)
Moderators: this is similar to "Xcode 4 exception breakpoint filtering", but I think that question takes too long to get around to the point and doesn't have any useful answers. Can they be linked?
For Core Data exceptions, what I typically do is remove the "All Exceptions" breakpoint from Xcode and instead:
Add a Symbolic Breakpoint on objc_exception_throw
Set a Condition on the Breakpoint to (BOOL)(! (BOOL)[[(NSException *)$x0 className] hasPrefix:#"_NSCoreData"])
The configured breakpoint should look something like this:
This will ignore any private Core Data exceptions (as determined by the class name being prefixed by _NSCoreData) that are used for control flow. Note that the appropriate register is going to be dependent on the target device / simulator that you are running in. Take a look at this table for reference.
Note that this technique can be adapted easily to other conditionals. The tricky part was in crafting the BOOL and NSException casts to get lldb happy with the condition.
I wrote an lldb script that lets you selectively ignore Objective-C exceptions with a much simpler syntax, and it handles both OS X, iOS Simulator, and both 32bit and 64bit ARM.
Installation
Put this script in ~/Library/lldb/ignore_specified_objc_exceptions.py or somewhere useful.
import lldb
import re
import shlex
# This script allows Xcode to selectively ignore Obj-C exceptions
# based on any selector on the NSException instance
def getRegister(target):
if target.triple.startswith('x86_64'):
return "rdi"
elif target.triple.startswith('i386'):
return "eax"
elif target.triple.startswith('arm64'):
return "x0"
else:
return "r0"
def callMethodOnException(frame, register, method):
return frame.EvaluateExpression("(NSString *)[(NSException *)${0} {1}]".format(register, method)).GetObjectDescription()
def filterException(debugger, user_input, result, unused):
target = debugger.GetSelectedTarget()
frame = target.GetProcess().GetSelectedThread().GetFrameAtIndex(0)
if frame.symbol.name != 'objc_exception_throw':
# We can't handle anything except objc_exception_throw
return None
filters = shlex.split(user_input)
register = getRegister(target)
for filter in filters:
method, regexp_str = filter.split(":", 1)
value = callMethodOnException(frame, register, method)
if value is None:
output = "Unable to grab exception from register {0} with method {1}; skipping...".format(register, method)
result.PutCString(output)
result.flush()
continue
regexp = re.compile(regexp_str)
if regexp.match(value):
output = "Skipping exception because exception's {0} ({1}) matches {2}".format(method, value, regexp_str)
result.PutCString(output)
result.flush()
# If we tell the debugger to continue before this script finishes,
# Xcode gets into a weird state where it won't refuse to quit LLDB,
# so we set async so the script terminates and hands control back to Xcode
debugger.SetAsync(True)
debugger.HandleCommand("continue")
return None
return None
def __lldb_init_module(debugger, unused):
debugger.HandleCommand('command script add --function ignore_specified_objc_exceptions.filterException ignore_specified_objc_exceptions')
Add the following to ~/.lldbinit:
command script import ~/Library/lldb/ignore_specified_objc_exceptions.py
replacing ~/Library/lldb/ignore_specified_objc_exceptions.py with the correct path if you saved it somewhere else.
Usage
In Xcode, add a breakpoint to catch all Objective-C exceptions
Edit the breakpoint and add a Debugger Command with the following command:
ignore_specified_objc_exceptions name:NSAccessibilityException className:NSSomeException
This will ignore exceptions where NSException -name matches NSAccessibilityException OR -className matches NSSomeException
It should look something like this:
In your case, you would use ignore_specified_objc_exceptions className:_NSCoreData
See http://chen.do/blog/2013/09/30/selectively-ignoring-objective-c-exceptions-in-xcode/ for the script and more details.
Here is an alternative quick answer for when you have a block of code e.g. a 3rd part library that throws multiple exceptions that you want to ignore:
Set two breakpoints, one before and one after the exception throwing block of code you want to ignore.
Run the program, until it stops at an exception, and type 'breakpoint list' into the debugger console, and find the number of the 'all exceptions' break point, it should look like this:
2: names = {'objc_exception_throw', '__cxa_throw'}, locations = 2
Options: disabled
2.1: where = libobjc.A.dylibobjc_exception_throw, address = 0x00007fff8f8da6b3, unresolved, hit count = 0
2.2: where = libc++abi.dylib__cxa_throw, address = 0x00007fff8d19fab7, unresolved, hit count = 0
This means it is breakpoint 2. Now in xcode, edit the first breakpoint (before the exception throwing code) and change the action to 'debugger command' and type in 'breakpoint disable 2' (and set 'automatically continue...' checkbox ).
Do the same for the break point after the offending line and have the command 'breakpoint enable 2'.
The all breakpoints exception will now turn on and off so it's only active when you need it.
I'm having trouble to use RegexKitLite to match string like
NSString *encodedPoints=[apiResponse stringByMatching: #"\\\"([^\\\"]*)\\\"^[^:]*"
capture: 0];
and apiResponse is:
#"http://maps.google.com/maps?output=dragdir&saddr=20.001364,73.749283&daddr=19.991499,73.744095"
So, to do by this way i am getting following error:
__NSCFString stringByMatching:capture:]: unrecognized selector sent to instance 0x131fc0
* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString
stringByMatching:capture:]: unrecognized selector sent to instance
0x131fc0'
* First throw call stack: (0x3422b8bf 0x3447b1e5 0x3422eacb 0x3422d945 0x34188680 0xb97b 0xad2f 0xaa2d 0xa617 0x34185435
0x375ef9eb 0x376b53cf 0x34185435 0x375ef9eb 0x375ef9a7 0x375ef985
0x375ef6f5 0x375f002d 0x375ee50f 0x375edf01 0x375d44ed 0x375d3d2d
0x30a06df3 0x341ff553 0x341ff4f5 0x341fe343 0x341814dd 0x341813a5
0x30a05fcd 0x37602743 0x4571 0x2838)
I have trying to find solution with googling but not getting exact solution.
Please help...
Ensure you have the correct library included into your project.
Go to your Project Navigator and selet the project.
Click on the Target and select the Build Phases tab, and open the Link Binary With Libraries.
Press the + Button, and search for libicucore.A.dylib. Add this library to your project.
Next, you will need to add the compile source, which is in Compile Sources just above Link Binary With Libraries. Once again, hit the + button and add RegexKitLite.m to the target. If you attempt to build the project at this state, you should get a lot of errors in the RegexKitLite.m file. To correct this, add the following compiler flag to the file by double clicking the RegexKitLite.m file in the Compile Sources area and then including -fno-objc-arc into the pop-up that appears. Hit done, and you will have hopefully added the library source to your project.
Just as a note, -fno-objc-arc removes the Automatic Reference Counting while compiling that source file. The errors the file gets without that compiler flag have to do with ARC, so it solves the problem.
This solved my issues when working with RegexKitLite, so hopefully it will for you.