Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/37.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.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
Iphone 核心数据-NSFetchRequest问题_Iphone_Core Data_Nsfetchrequest - Fatal编程技术网

Iphone 核心数据-NSFetchRequest问题

Iphone 核心数据-NSFetchRequest问题,iphone,core-data,nsfetchrequest,Iphone,Core Data,Nsfetchrequest,我的NSFetchRequest有问题,它似乎没有提取任何数据,代码如下: -(void)addAnnotations { NSFetchRequest *request = [[NSFetchRequest alloc] init]; NSEntityDescription *entity = [NSEntityDescription entityForName:@"WayPoint" inManagedObjectContext:managedObjectC

我的NSFetchRequest有问题,它似乎没有提取任何数据,代码如下:

-(void)addAnnotations 
{       
    NSFetchRequest *request = [[NSFetchRequest alloc] init];

    NSEntityDescription *entity = [NSEntityDescription entityForName:@"WayPoint" inManagedObjectContext:managedObjectContext];
    [request setEntity:entity];

    //NSPredicate *predicate = [NSPredicate predicateWithFormat:@"waypoint_map_id=%i", 98];
    //[request setPredicate:predicate];

    NSError *error;
    listArray = [[managedObjectContext executeFetchRequest:request error:&error] mutableCopy];
    [request release];

    NSLog(@"Array: ", listArray);
}
解决的问题:

NSLog(@"Array: %d", listArray);

您应该使用
%@
而不是
%d
。d代表整数,@代表对象。