Delete parse class and object in class - ios

I try to delete a class called "test". I found some code but nothing happens. The class are still exist.
-(void)delete{
PFObject *deleteClass = [PFObject objectWithClassName:#"test"];
[deleteClass deleteEventually];
}
Error message:
Failed to run command eventually with error: Error Domain=Parse Code=106 "(null)" UserInfo={message=Failed to run an eventually command., exception=Attempt to delete non-existent object.}

Edit 1: After looking through more Parse forums, I've found a definitive answer stating that you cannot do this with the Parse SDK; you must use the Parse website.
From this question on the Parse website, it looks like this should be done from your Parse dashboard. If you are constantly creating and deleting new classes and need to do this dynamically, I'm not sure you are using Parse in the way it was intended.

Related

The call is ambiguous between the following methods or properties: 'QuickFix.Fields.Converters.DateTimeConverter.Nanosecond(System.DateTime)'

I try to run Quickfix\n project and I face the above error with 6846 warnings. Why does this happen ? I see that many resolve this error message by modifying the code (i mean general this error message & not especially for the project of quickfix\n) but I didn't write this code so that to be in somewhere mistake while I get the quickfix\n as project to run it

unable to extract model type swift

I'm having a slight issue with CoreML using Swift Playgrounds while attempting to make a gender classifier model. When I add the Gender.mlmodel and Gender.swift to their respective folders within the Playground Page (Resources/ and Sources/), I get a rather peculiar error, shown below:
Fatal error: 'try!' expression unexpectedly raised an error: Error Domain=com.apple.CoreML Code=0 "Unable to extract model type from stream in compiled model: Error opening file stream: /var/folders/kt/11b_lk412hv327qjhvgnhvzr0000gn/T/com.apple.dt.Xcode.pg/auxiliarymodules/7C17E9A3-54C7-4828-96BD-00AE07EC7F3E/Gender_Classifier_PageSources.framework/Resources/Gender.mlmodel/coremldata.bin: unspecified iostream_category error" UserInfo={NSLocalizedDescription=Unable to extract model type from stream in compiled model: Error opening file stream: /var/folders/kt/11b_lk412hv327qjhvgnhvzr0000gn/T/com.apple.dt.Xcode.pg/auxiliarymodules/7C17E9A3-54C7-4828-96BD-00AE07EC7F3E/Gender_Classifier_PageSources.framework/Resources/Gender.mlmodel/coremldata.bin: unspecified iostream_category error}: file /BuildRoot/Library/Caches/com.apple.xbs/Sources/swiftlang/swiftlang-900.0.74.1/src/swift/stdlib/public/core/ErrorType.swift, line 181
I've thought that it had an issue accessing the file itself, so I tried using different locations and the absolute path as a String (which returned a value when force-unwrapped), but to no avail. In addition, I tried other models that I know are able to be loaded (SqueezeNet.mlmodel), and that did not work as well, returning a comparable error.
I appreciate any help that anyone would be able to offer, I'm completely perplexed by this issue. Thank you!
I found the solution to this: apparently Swift Playgrounds does not compile .mlmodel to .mlmodelc, thus causing the failure to read a non-compiled model. For anyone else wondering, just run MLModel.compile(at: URL?) to convert it to the compiled format.
In Swift 5.2.3, the following is correct.
let url = try MLModel.compileModel(at: URL(fileURLWithPath: "<#/path/to/read/model.mlmodel#>"))
let mode = try MLModel(contentsOf: url)

Parse local datastore doesn't work - Swift 2

I am currently using the latest version of Parse 1.14.2 and Bolts 1.8.4.Parse is implemented correctly and I have been using it for a long time now. The problem I'm facing now is when I try to use Parse's local datastore. I have the following code in my AppDelegate.swift:
Parse.enableLocalDatastore()
Parse.setApplicationId("ID",
clientKey: "Client_Key")
I have the following code to create and save a string named firstName in a class named contact:
let contact = PFObject(className: "contact")
contact["firstName"] = "Jack"
contact.pinInBackground()
Here is the code to retrieve objects from the created class:
let query = PFQuery(className: "contact")
query.fromLocalDatastore()
query.getFirstObjectInBackgroundWithBlock({ (object, error) -> Void in
if error == nil {
if let contact = object {
print(contact.objectForKey("firstName"))
}
}
})
I have added libsqlite3.dylib to my project. My app doesn't crash when I run this code but it simply gives me the following message when I try to retrieve objects:
2016-08-29 11:31:38.049 App_Demo[14436:3504319] [Bolts] Warning: `BFTask` caught an exception in the continuation block.
This behavior is discouraged and will be removed in a future release.
Caught Exception: Method requires Pinning enabled.
Can anyone help me to work around this issue? I am guessing the issue is that this version of Bolts cannot pin Parse objects in the background and I need to work my way around this bug. Any help would be appreciated as I have been stuck at this for a while and can't find too much info online.
Edited: I have tried downgrading Bolts, but then Parse downgrades with it in Cocoapod and it causes errors in Xcode.
it's not objectforkey.
You need to call object["UsedName"] "UsedName" being the key. Hope that helps.

Google tag manager error

I´m having these messages:
GoogleTagManager error: _us has no backing implementation.
GoogleTagManager error: Failed to parse an invalid boolean:
Do you know why this happens?
Seems like you're referring to a buil-in variable that no longer exists, see this answer on a similar post:
https://stackoverflow.com/a/31041264/805337
EDIT: this could happen if you deactivate a built-in variable or if you changed the GTM version you're using

XCode7 Core Data: Fetch for objects etc

I created an iOS8 application and updated it to XCode7. I have a couple of problems after I recreated the NSManagedObject.
First I get an error, if I fetch for contacts and iterate over them:
let contacts = try self.managedObjectContext.executeFetchRequest(request) as! [Contact]
for contact in contacts{
//--> EXC_BAD_INSTRUCION
}
Contact is my NSManagedObject. I do not get any compiler error or warning.
Second: I get this warning:
CoreData: warning: Unable to load class named 'MyAppName.Contact' for entity 'Contact'. Class not found, using default NSManagedObject instead.
What can cause this? The #objc(Contact) in Contact has already been generated bei XCode and now I can't set the className MyAppName.Contact in CoreData-editor. Any suggestion?
Finally found it. All the other tips are not working, because Apple has changed it with XCode7.
Now XCode creates #(Classname) in the NSManagedSubclass. This needs to be commented out (beta1 and beta2). Then XCode can find your class.

Resources