After reviewing your solution I found where I had my problem, which is I used logger instead of nil for ‘object’. Would be nice if anyone can pitch in and explain using nil for object in the method addObserverForName: object: queue: usingBlock:
Sarkha, I did exactly the same as you did. I passed logger for the object.
After giving the apple documentation on the particular method another glance I noticed this:
[quote] obj
The object whose notifications you want to add the block to the operation queue.
If you pass nil, the notification center doesn’t use a notification’s sender to decide whether to add the block to the operation queue.
[/quote]
That’s a straight copy paste from the Parameters section in the Documentation. I think it’s pretty self-explanatory, even though I missed it the first time I read through it as well.
To clarify: We used the instance *logger of BNRLogger to use the method zoneChange, but since we’re not using that method anymore, but simply want te method of NSNotificationCenter to use the block we made to be used there is no use of the entire object of BNRLogger. At least, not for this part in the code. Further on with the downloading of the file it’s still used, of course.
Thinking about it, I think it’s possible to somehwere put the block in the class BNRLogger to still use it like that, but that’s a bit too confusing for me to really figure out haha
Yep, I had the same problem as others I had “object:logger” as soon as I changed to “object:nil” it worked fine. I was suspicious of “logger”, since the “zoneChange” method in “logger” didn’t seem to be in the game. Thanks for the pointer.
An example of using this method and not using nil for the argument for object: would be great!
Also I just came up with this questioned, is there a more appropriate way to refer to the different portions of a method and its arguments than I did above?
i.e.- saying “the argument for the object: portion of” seems poor/improper jargon