I'm trying to insert Array of dictionary in CoreData using NSBatchInsertRequest according WWDC 2019 (https://developer.apple.com/videos/play/wwdc2019/230/). The insertResult is nil, and my CoreData is empty.
let modelURL = Bundle.main.url(forResource: "CoreDataPerformance", withExtension: "momd")!
let model = NSManagedObjectModel(contentsOf: modelURL)!
let container = NSPersistentCloudKitContainer(name: "CoreDataPerformance", managedObjectModel: model)
container.loadPersistentStores(completionHandler: { (storeDescription, error) in
if let error = error as NSError? {
fatalError("Unresolved error \(error), \(error.userInfo)")
}
})
try container.viewContext.setQueryGenerationFrom(.current)
let moc = container.viewContext
moc.automaticallyMergesChangesFromParent = true
moc.perform {
let insertRequest = NSBatchInsertRequest(entity: Client.entity(), …Run Code Online (Sandbox Code Playgroud) 我试图得到用户的事件.登录后我用以下代码询问用户ID:
[[[FBSDKGraphRequest alloc] initWithGraphPath:@"me" parameters:nil]
startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
NSLog(@"ID: %@", result[@"id"]);
NSString *str = [NSString stringWithFormat:@"%@/events",result[@"id"]];
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:str
parameters:nil
HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
id result,
NSError *error) {
// Handle the result
}];
}];
Run Code Online (Sandbox Code Playgroud)
结果是空的,虽然在图api资源管理器我得到数据!
谢谢
如何使用NSLog获取consol,UITextView上的gestureRecogniser列表?
这样的事情?
NSLog([UIGestureRecognizer description]);
Run Code Online (Sandbox Code Playgroud) 这是我的主要内容:
int main(void)
{
char w1[] = "Paris";
ChangeTheWord(w1);
printf("The new word is: %s",w1);
return0;
}
Run Code Online (Sandbox Code Playgroud)
我需要更改w1[]此函数的值:
ChangeTheWord(char *Str)
{
...
}
Run Code Online (Sandbox Code Playgroud) ios ×2
objective-c ×2
arrays ×1
c ×1
core-data ×1
facebook ×1
iphone ×1
nslog ×1
nspersistentcloudkitcontainer ×1
pointers ×1
swift ×1
uitextview ×1
xcode ×1