Too many @selector statements?
Too many @selector statements?
- Subject: Too many @selector statements?
- From: Christoffer Lernö <email@hidden>
- Date: Sun, 2 Oct 2005 09:14:23 +0200
I'm having the weirdest bug. It looks like "@selector" stops working
after making a few invocations in a row. I really honestly don't
understand this bug one bit.
Having this code crashes (with bus error)
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector
(otherLeaderBorn:)
name:@"leaderBorn"
object:area];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector
(otherLeaderEntered:)
name:@"leaderEntered"
object:area];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector
(otherLeaderLeft:)
name:@"leaderLeft"
object:area];
But not this:
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector
(otherLeaderBorn:)
name:@"leaderBorn"
object:area];
//[[NSNotificationCenter defaultCenter] addObserver:self
// selector:@selector
(otherLeaderEntered:)
//
name:@"leaderEntered"
// object:area];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector
(otherLeaderLeft:)
name:@"leaderLeft"
object:area];
Nor this:
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector
(otherLeaderBorn:)
name:@"leaderBorn"
object:area];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector
(otherLeaderEntered:)
name:@"leaderEntered"
object:area];
//[[NSNotificationCenter defaultCenter] addObserver:self
// selector:@selector
(otherLeaderLeft:)
// name:@"leaderLeft"
// object:area];
And not this either (using the selector for the same method twice)
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector
(otherLeaderBorn:)
name:@"leaderBorn"
object:area];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector
(otherLeaderEntered:)
name:@"leaderEntered"
object:area];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector
(otherLeaderEntered:)
name:@"leaderLeft"
object:area];
Somehow it would seem as @selector occasionally returns some weird
value if you call it a few times in a row(!!!!????)
/Christoffer
---
(Tiger with XCode 2.1 on a PB)
Relevant (?) part of the crash log:
Exception: EXC_BAD_ACCESS (0x0001)
Codes: KERN_PROTECTION_FAILURE (0x0002) at 0x00000021
Thread 0 Crashed:
0 libobjc.A.dylib 0x909ad0f8 objc_msgSend + 24
1 com.apple.Foundation 0x92882878 _nsnote_callback + 180
2 com.apple.CoreFoundation 0x907726a0 __CFXNotificationPost
+ 368
3 com.apple.CoreFoundation 0x9076a7c4
_CFXNotificationPostNotification + 684
4 com.apple.Foundation 0x9286cc80 -[NSNotificationCenter
postNotificationName:object:userInfo:] + 92
Thread 0 crashed with PPC Thread State 64:
srr0: 0x00000000909ad0f8 srr1:
0x000000000200f030 vrsave: 0x0000000000000000
cr: 0x44000282 xer: 0x0000000020000001 lr:
0x0000000092882878 ctr: 0x00000000909ad0e0
r0: 0x0000000092882878 r1: 0x00000000bfff8fa0 r2:
0x00000000005184b0 r3: 0x0000000000517dd0
r4: 0x0000000000313e20 r5: 0x0000000000517500 r6:
0x00000000bfff9074 r7: 0x00000000000000ff
r8: 0x00000000bfff9060 r9: 0x0000000000000003 r10:
0x00000000000069d4 r11: 0x00000000ffcf3e20
r12: 0x0000000000000001 r13: 0x0000000000000000 r14:
0x0000000000000001 r15: 0x0000000000000000
r16: 0x0000000000000001 r17: 0x0000000000518810 r18:
0x0000000000517500 r19: 0x00000000005168f0
r20: 0x00000000000b8040 r21: 0x00000000a0722540 r22:
0x0000000000000004 r23: 0x0000000000000000
r24: 0x00000000003051b0 r25: 0x0000000000000000 r26:
0x0000000000000000 r27: 0x0000000000516900
r28: 0x00000000000db020 r29: 0x00000000bfff8ff0 r30:
0x0000000000000000 r31: 0x00000000928827dc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden