Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/110.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
Ios 从服务器分组数据而不按字母排序_Ios_Objective C_Web Services_Sorting_Grouping - Fatal编程技术网

Ios 从服务器分组数据而不按字母排序

Ios 从服务器分组数据而不按字母排序,ios,objective-c,web-services,sorting,grouping,Ios,Objective C,Web Services,Sorting,Grouping,我需要来自web服务的组数据,我已经使用dictionary完成了这项工作,但它按字母顺序排序,我不需要排序,我希望它以web服务中的方式显示 self.searchSections = [[NSMutableDictionary alloc] init]; NSError *error = nil; NSDictionary *xmlDict = [XMLReader dictionaryForXMLString:Str error:&error]; NSA

我需要来自web服务的组数据,我已经使用dictionary完成了这项工作,但它按字母顺序排序,我不需要排序,我希望它以web服务中的方式显示

   self.searchSections = [[NSMutableDictionary alloc] init];

   NSError *error = nil;
   NSDictionary *xmlDict = [XMLReader dictionaryForXMLString:Str error:&error];

   NSArray *leaguelist = [[[xmlDict objectForKey:@"GetLeagueNamesListOutput"] objectForKey:@"Leagues"] objectForKey:@"eLeagueMst"];

    if (leaguelist.count>0)
    {
        if (![leaguelist isKindOfClass:[NSArray class]])
        {
            // if 'list' isn't an array, we create a new array containing our object
            leaguelist = [NSArray arrayWithObject:leaguelist];
        }

        // we can loop through items safely now
        for (NSDictionary *item in leaguelist)
        {
            NSString *c = [[item objectForKey:@"CountryName"] objectForKey:@"text"];
            found = NO;

            for (NSString *str in [self.searchSections allKeys])
            {
                if ([str isEqualToString:c])
                {
                    found = YES;
                }
            }

            if (!found)
            {
                [self.searchSections setValue:[[NSMutableArray alloc] init] forKey:c];
            }
        }

        // Loop again and sort the books into their respective keys
        for (NSDictionary *book in leaguelist)
        {
            [[self.searchSections objectForKey:[[book objectForKey:@"CountryName"] objectForKey:@"text"]] addObject:book];
        }

显示您的代码。。。其他智者帮不上忙你能分享你的代码吗?有谁能帮我吗