[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
NSNumber and accessing a long value
From: |
Riccardo Mottola |
Subject: |
NSNumber and accessing a long value |
Date: |
Fri, 03 Jul 2015 16:10:28 +0200 |
User-agent: |
Mozilla/5.0 (X11; FreeBSD i386; rv:36.0) Gecko/20100101 Firefox/36.0 SeaMonkey/2.33.1 |
Hi,
I am getting a strange exception (with subsequent crash) in an
application when running on GNUstep. The same application appears to
work fine on Mac.
What appears to cause the problem is accessing longValue from a NSNumber
which appears however to be valid?
Are NSNumber different depending on how they are created? I suppose not,
they shouldn't at least.
I get a crash here:
#8 0x080559ee in -[FutureTracker updateData:] (self=0x2c4cb088,
_cmd=0x8077c48, arg=0x0) at FutureTracker.m:234
234 NSLog(@"%@ %ld", futureN, [futureN longValue]);
(gdb) p futureN
$1 = (class NSNumber *) 0x2c478268
(gdb) po futureN
9051
exactly when I print out longValue,getting an exception that the method
is not recognized.
What is going wrong?
Riccardo
(gdb) up
#1 0x288cdf1d in +[NSException raise:format:arguments:] (self=0x28b7e000,
_cmd=0x28b7e0e8, name=0x28b7df48, format=0x28b926d0,
argList=0xbfbfdca4 "Æ5¡(Þ\034¯(á¸\006\bÆ5¡(") at NSException.m:854
854 [except raise];
(gdb) up
#2 0x288cde91 in +[NSException raise:format:] (self=0x28b7e000,
_cmd=0x28b92928, name=0x28b7df48, format=0x28b926d0) at
NSException.m:840
840 [self raise: name format: format arguments: args];
(gdb) up
#3 0x28918fb1 in -[NSObject doesNotRecognizeSelector:] (self=0x2c478268,
_cmd=0x28b92a38, aSelector=<value optimized out>) at NSObject.m:1761
1761 [NSException raise: NSInvalidArgumentException
(gdb) up
#4 0x2891903f in -[NSObject forwardInvocation:] (_cmd=<value optimized
out>,
anInvocation=<value optimized out>) at NSObject.m:1779
1779 [anInvocation invokeWithTarget: target];
(gdb) up
#5 0x289d4b67 in GSFFIInvocationCallback (retp=<value optimized out>,
args=<value optimized out>) at GSFFIInvocation.m:629
629 [obj forwardInvocation: invocation];
(gdb) up
#6 0x2b0142e2 in ffi_call () from /usr/local/lib/libffi.so.6
(gdb) up
#7 0x2b0148da in ffi_call_SYSV () from /usr/local/lib/libffi.so.6
(gdb) up
#8 0x080559ee in -[FutureTracker updateData:] (self=0x2c4cb088,
_cmd=0x8077c48, arg=0x0) at FutureTracker.m:234
234 NSLog(@"%@ %ld", futureN, [futureN longValue]);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- NSNumber and accessing a long value,
Riccardo Mottola <=