小编jes*_*ssy的帖子

在外部水龙头上关闭模态视图表单控制器

我将一个模态视图控制器呈现为一个表单,并在单击取消按钮(即一个条形按钮项目)时将其解除.当我在该视图之外点击时,我需要忽略它.请帮我一个参考.注意:我的模态视图控制器带有导航控制器.

@cli_hlt,@ Bill Brasky感谢您的回答.当在作为表单的模态视图之外发生敲击时,我需要忽略它.我在下面粘贴我的代码.

-(void)gridView:(AQGridView *)gridView didSelectItemAtIndex:(NSUInteger)index  
{        
    if(adminMode) 
    {
        CHEditEmployeeViewController *editVC = [[CHEditEmployeeViewController alloc] initWithNibName:@"CHEditEmployeeViewController" bundle:nil];
        editVC.delegate = self;
        editVC.pickedEmployee = employee;
        editVC.edit = TRUE;
        editVC.delegate = self;
        UINavigationController *navigationController = [[UINavigationController alloc]initWithRootViewController:editVC];
        navigationController.modalPresentationStyle = UIModalPresentationFormSheet;
        [self presentModalViewController:navigationController animated:YES];

        return;
    }   //the above code is from the view controller which presents the modal     view. Please look at the below code too which is from my modal view controller. Please guide me in a proper way.   -(void)tapGestureRecognizer {

    UITapGestureRecognizer *recognizer …
Run Code Online (Sandbox Code Playgroud)

xcode objective-c uinavigationcontroller modalviewcontroller

32
推荐指数
9
解决办法
3万
查看次数

如何在ios编程中使用地址簿API获取联系人?

我有个问题.我是这个ios编程的新手.我正在做一个基本类似于iPhone中的地址簿的应用程序.我需要从地址簿中获取所有联系人,并在表格视图中显示它们.谁能帮助我如何使用地址簿Api获取联系人?我很感激你的帮助.

xcode tableview ios

5
推荐指数
1
解决办法
2万
查看次数

如何让用户修改UITableView单元格中的文本

我有一个关于合适的观点的问题.

我正在实现一个类似于地址簿app的应用程序.我能够以编辑模式呈现表格视图.我想让用户在编辑模式下编辑单元格中的文本.我知道为了编辑单元格中的文本,我需要一个文本字段.我创建了一个文本字段.

我的问题是:

  1. 我该怎么做才能在单元格中显示该文本字段.

  2. 为了在编辑模式下在表视图中显示该文本字段,我需要实现哪些方法.

  3. 完成编辑后,如何更新联系人视图控制器中的数据(包含所有联系人).保存应保留在地址簿中.对于这个问题,我知道我需要实现一些委托方法,但我不知道该怎么做.

请查看以下代码,以便您了解我的问题.

 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath: (NSIndexPath *)indexPath
{
[tableView setSeparatorColor:[UIColor clearColor]];
//[self.tableView setEditing: YES  animated: YES];


static NSString *CellIdentifier = @"Cell";

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

// Configure the cell...
if(isEditingOn) {

if(cell == nil)
        cell = [self getCellContentView:CellIdentifier];
     UILabel *lblTemp1 = (UILabel *)[cell viewWithTag:1];
     UITextField *textfield1=(UITextField*)[cell viewWithTag:2];

if(indexPath.row == 0) {
        lblTemp1.text = @"Name";
        textfield1.text = myContact.name;
    }

else …
Run Code Online (Sandbox Code Playgroud)

xcode uitableview ios

3
推荐指数
1
解决办法
1万
查看次数