Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/118.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
Objective c 身份证传输问题_Objective C_Ios_Ios4 - Fatal编程技术网

Objective c 身份证传输问题

Objective c 身份证传输问题,objective-c,ios,ios4,Objective C,Ios,Ios4,这似乎是一件很简单的事情,但我不知道怎么做 目前,我有一个居住在各大洲的rootView: 守则: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueR

这似乎是一件很简单的事情,但我不知道怎么做

目前,我有一个居住在各大洲的rootView:

守则:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}

// Configure the cell.

    cell.accessoryType=UITableViewCellAccessoryDisclosureIndicator;
    //Continent is the class. continents is an array to store data
    Continent *cont=[self.continents objectAtIndex:[indexPath row]]; 
    cell.textLabel.text=cont.continentName;
    return cell;
    }

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
Continent *cont=[self.continents objectAtIndex:[indexPath row]];
SelectedContinent* selectedContinent=[[SelectedContinent alloc] initWithNibName: @"SelectedContinent" bundle: nil];

//NSLog(@"%@",cont.continentName);
[self.navigationController pushViewController: selectedContinent animated: YES];
[selectedContinent setTitle:cont.continentName];
[selectedContinent setContinentID:cont.continentID];
[selectedContinent release];
}
我用nib文件创建了一个新的viewcontroller。给了他桌面视图。现在我需要从SQLite文件填充国家。我创建了一个DBAccess类,该类应该执行所有数据库操作,并且为每个大陆编写了一个特殊的方法。然后我想到写很多方法是愚蠢的想法,而普遍的方法来到了世界:

-(NSMutableArray*)getTheCountriesEurope:(int)continentID
{
NSMutableArray* euCountriesArray=[[[NSMutableArray alloc]init]autorelease];
NSString* sqlContinents = [NSString stringWithFormat:
                   @"SELECT countries.countryID,countries.countryName\
                   FROM countries\
                   WHERE countries.relativeToContinentID=%i"
                   ,continentID];
/*const char* sqlContinents="SELECT countries.countryID,countries.countryName\
FROM countries\
WHERE countries.relativeToContinentID=?";*/
sqlite3_stmt *statement;
int sqlResult = sqlite3_prepare_v2(database, sqlContinents, -1, &statement, NULL);
if ( sqlResult== SQLITE_OK)
{
    while (sqlite3_step(statement) == SQLITE_ROW)
    {
        Country *countryObj = [[Country alloc] init];
        char *countryName = (char *)sqlite3_column_text(statement, 1);
        countryObj.countryID = sqlite3_column_int(statement, 0);
        countryObj.countryName = (countryName) ? [NSString stringWithUTF8String:countryName] : @"";
        [euCountriesArray addObject:countryObj];
        NSLog(@"%@",countryObj.countryName);
        [countryObj release];
    }
    sqlite3_finalize(statement);
}
else
{
    NSLog(@"Problem with the database:"); 
    NSLog(@"%d",sqlResult);
}
return euCountriesArray;

 }
无论如何,这个方法也有问题,我被告知要实现int-sqlite3\u-bind\u-intsqlite3\u-stmt*,int,int;方法也一样

嗯,目前我的问题是,我无法从RootViewController类中捕获continentID值,我需要它将该值作为参数提供给方法

这样分配countryID是否正确

在RootViewController中。如果是,那么如何获得该变量的值

当我推另一个视图时,我只看到标题,至少它显示正确

求救


在推送视图之前,需要指定值

[SelectedContinental设置标题:cont.Continental名称]; [SelectedContinental设置Continental ID:cont.Continental ID]; [self.navigationController pushViewController:selected:YES]

 [selectedContinent setTitle:cont.continentName];
 [selectedContinent setContinentID:cont.continentID];