Created
September 4, 2012 22:42
-
-
Save ikura/3627575 to your computer and use it in GitHub Desktop.
Broken queries for pointers in array
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
[super viewDidLoad]; | |
// Do any additional setup after loading the view, typically from a nib. | |
[Parse setApplicationId:kDevParseAppId clientKey:kDevParseClientKey]; | |
#define kTestClass @"TestArrayClass" | |
#define kTestKey @"testArray" | |
PFObject *person = [PFObject objectWithoutDataWithClassName:@"Person" objectId:@"NPec5gZPW7"]; | |
PFObject *testArray = [PFObject objectWithClassName:kTestClass]; | |
[testArray addUniqueObject:person forKey:kTestKey]; | |
[testArray save]; | |
PFQuery *query = [PFQuery queryWithClassName:kTestClass]; | |
[query whereKey:kTestKey equalTo:person]; | |
NSLog(@"Search term: %@", person.fetchIfNeeded); | |
NSLog(@"Expect results to contain: %@", testArray); | |
NSError *error =nil; | |
NSArray *results = [query findObjects:&error]; | |
NSLog(@"Results%@: %@", error ? [NSString stringWithFormat:@" (Error: %@)", error] : @"", | |
results); | |
NSLog(@"Test objects: %@", [PFQuery queryWithClassName:kTestClass].findObjects); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
2012-09-05 06:40:45.023 parseScaffold[23258:c07] Search term: Person:NPec5gZPW7 {
SinaWeiboID = ;
ssCugtID = ;
}
2012-09-05 06:40:45.024 parseScaffold[23258:c07] Expect results to contain: TestArrayClass:TuAL7r1FBJ {
testArray = (
"Person:NPec5gZPW7 {\n}"
);
}
2012-09-05 06:40:45.421 parseScaffold[23258:c07] Results: (
)
2012-09-05 06:40:45.753 parseScaffold[23258:c07] Test objects: (
"TestArrayClass:RA747oC369 {\n testArray = (\n "Person:NPec5gZPW7 {\n}"\n );\n}",
"TestArrayClass:JwqaaJVqZK {\n testArray = (\n "Person:NPec5gZPW7 {\n}"\n );\n}",
"TestArrayClass:pGKN0ty7sl {\n testArray = (\n "Person:NPec5gZPW7 {\n}"\n );\n}",
"TestArrayClass:VVNdp5GwwN {\n testArray = (\n "Person:NPec5gZPW7 {\n}"\n );\n}",
"TestArrayClass:lfIQPZfN51 {\n testArray = (\n "Person:NPec5gZPW7 {\n}"\n );\n}",
"TestArrayClass:swGPO7rBHJ {\n testArray = (\n "Person:NPec5gZPW7 {\n}"\n );\n}",
"TestArrayClass:Qw5Ndn27En {\n testArray = (\n "Person:NPec5gZPW7 {\n}"\n );\n}",
"TestArrayClass:OmqqklOe6N {\n testArray = (\n "Person:NPec5gZPW7 {\n}"\n );\n}",
"TestArrayClass:wo6oBWHNim {\n testArray = (\n "Person:NPec5gZPW7 {\n}"\n );\n}",
"TestArrayClass:gu6pB1yXE1 {\n testArray = (\n "Person:NPec5gZPW7 {\n}"\n );\n}",
"TestArrayClass:TuAL7r1FBJ {\n testArray = (\n "Person:NPec5gZPW7 {\n}"\n );\n}"
)