Search code examples
iphoneios5ios4icloudnsnotificationcenter

iCloud Notification Crash in ios < 5


I'm getting a crash on an iPod Touch ios v4.3.1 related to iCloud.

Crash Log:

Date/Time:       2012-06-12 11:42:43.557 -0700
OS Version:      iPhone OS 4.3.1 (8G4)
Report Version:  104

Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x00000001, 0xe7ffdefe
Crashed Thread:  0

Dyld Error Message:
  Symbol not found: _NSUbiquitousKeyValueStoreDidChangeExternallyNotification
  Referenced from: /var/mobile/Applications/997BA11D-FD1E-4755-860C-2A708D5E39EF/AppName.app/AppName
  Expected in: /System/Library/Frameworks/Foundation.framework/Foundation
 in /var/mobile/Applications/997BA11D-FD1E-4755-860C-2A708D5E39EF/AppName.app/AppName
  Dyld Version: 191.3

But the code shouldn't be registering for any iCloud services. I have the following code in place, and I've stepped through it making sure that on this device, it never registers for observing iCloud notifications:

if(NSClassFromString(@"NSUbiquitousKeyValueStore")) { // is iOS 5?
    if([NSUbiquitousKeyValueStore defaultStore]) {  // is iCloud enabled
        [self addObservers];
    }
}

Thanks!


Solution

  • Foundation framework needed to be "optional" / weak linked