Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/98.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 无法清除Xcode 6中的用户默认值_Ios_Xcode_Persistence_Nsuserdefaults - Fatal编程技术网

Ios 无法清除Xcode 6中的用户默认值

Ios 无法清除Xcode 6中的用户默认值,ios,xcode,persistence,nsuserdefaults,Ios,Xcode,Persistence,Nsuserdefaults,尝试使用以下代码清除UserDefaults(持久性数据)时: var mainBundle:NSBundle = NSBundle.mainBundle() var appDomain:NSString = mainBundle.bundleIdentifier! userDefaults.removePersistentDomainForName(appDomain) 第三条语句不会编译,但会生成Apple Mach-O链接器错误: Ld /Users/Alexan

尝试使用以下代码清除UserDefaults(持久性数据)时:

    var mainBundle:NSBundle = NSBundle.mainBundle()
    var appDomain:NSString = mainBundle.bundleIdentifier!
    userDefaults.removePersistentDomainForName(appDomain)
第三条语句不会编译,但会生成Apple Mach-O链接器错误:

Ld /Users/Alexander/Library/Developer/Xcode/DerivedData/AD62-bxdlketythywrzhfutzehevdbmyx/Build/Products/Debug-iphonesimulator/AD62.app/AD62 normal x86_64
    cd /Users/Alexander/Desktop/AD62
    export IPHONEOS_DEPLOYMENT_TARGET=8.0
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
...    
Undefined symbols for architecture x86_64:
  "__TFSs26_forceBridgeFromObjectiveCU__FTPSs9AnyObject_MQ__Q_", referenced from:
      __TFC4AD6226ProfileTableViewController13viewDidAppearfS0_FSbT_ in ProfileTableViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
非常感谢您的帮助。

此功能:

var mainBundle:NSBundle = NSBundle.mainBundle()
userDefaults.removePersistentDomainForName(mainBundle.bundleIdentifier!)
我看不出有多大区别,但事实就是这样