Note that there are some explanatory texts on larger screens.

plurals
  1. PONSNotification troubles
    primarykey
    data
    text
    <p>When my class initializes, it adds itself as an observer for a bunch of different Wi-Fi notifications. For some reason, the selector isn't running when any of these things happen. Any ideas? Thank you ahead of time.</p> <pre><code>-(id) init { if (self) { sself = self; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleNotification:) name:CWModeDidChangeNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleNotification:) name:CWSSIDDidChangeNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleNotification:) name:CWBSSIDDidChangeNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleNotification:) name:CWCountryCodeDidChangeNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleNotification:) name:CWLinkDidChangeNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleNotification:) name:CWPowerDidChangeNotification object:nil]; </code></pre> <p>UPDATE: Here is the handleNotification method:</p> <pre><code>-(void) handleNotification:(NSNotification*) notification { NSLog(@"Notification Received"); } </code></pre> <p>I have included the CoreWLAN framework to my project: <img src="https://i.stack.imgur.com/5iNBg.png" alt="enter image description here"></p> <p>I've downloaded CoreWLANWirelessManager.app, and this is what I'm using for reference. Oddly enough, Apple's code is using deprecated notifications, and it still works. I've tried using the new API's and the deprecated API's with no success. I'm not sure if I can post their code here, but there is literally no difference. The selector even has the same name. </p> <p>Please don't hesitate to ask for further elaboration.</p> <p>UPDATE (After Dustin's answer): I've created a new project in hopes to isolate the issue. I set up my .h and .m files just as you described. Sadly, I'm still not getting any notifications. To show you I'm not lying (or crazy), I've included two (fairly crowded) screenshots that were taken during the same runtime. Notice: (1. I have a breakpoint in the handleNotification: method. The app never pauses. (2. I included the network window to show my Mac <em>has</em> indeed changed Wi-Fi networks during this runtime. (3. Nothing is NSLoged</p> <p>Network 1: <img src="https://i.stack.imgur.com/2HfgG.png" alt="enter image description here"></p> <p>Network 2: <img src="https://i.stack.imgur.com/veola.png" alt="enter image description here"></p> <p>UPDATE May 17, 2012: Dustin's answer was correct, but the Wi-Fi interface name varies depending on what hardware the app is running on. In my case, (MacBook Air; no ethernet), my Wi-Fi is en0 instead of en1. I managed to grab the system configuration plst file off my moms iMac, and the Wi-Fi is called en1. Ethernet is en0. Thank you all for your help.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload