我正在使用Parse并启用本地数据存储。我保留了两个后端,一个用于开发,另一个用于测试并注释掉其中一个。
经过一次编辑后,我收到了错误消息:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Method requires Pinning enabled.'*** First throw call stack:
(
0 CoreFoundation 0x0000000106665c65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x00000001062febb7 objc_exception_throw + 45
2 CoreFoundation 0x0000000106665b9d +[NSException raise:format:] + 205
3 MyAppName 0x00000001053e5fad -[PFQuery fromPinWithName:] + 65
4 MyAppName
//and so on..
通过回溯我所做的事情,我发现我错误地启用了两个后端,如下所示:
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
//-----------------Parse customizations------------------------------
// Enable storing and querying data from Local Datastore.
// Remove this line if you don't want to use Local Datastore features or want to use cachePolicy.
Parse.enableLocalDatastore()
// ****************************************************************************
// Uncomment this line if you want to enable Crash Reporting
// ParseCrashReporting.enable()
//
// Uncomment and fill in with your Parse credentials:
//This one is for the MyAppName Parse App
MyModel.registerSubclass()
// This the main App
Parse.setApplicationId("someId1", clientKey: "someKey1")
//This is the test app
Parse.setApplicationId("anotherID2", clientKey: "anotherKey2")
//Note: Only one of the above should be enabled, not both
//In this instance, I forgot to uncomment the first resulting in the error message.
//and so on..
在这种情况下,我通过与错误消息无关的方式发现了错误。那么什么是逻辑思维过程才能让我从错误信息转到我的错误?