ios知识整理

本文详细介绍了iOS和Android应用开发中用户界面交互、数据存储及数据展示的关键技术,包括界面跳转、数据获取、对话框弹出、用户名存储等核心功能。同时,展示了如何在界面中加入返回按钮实现导航功能,以及如何使用弹出对话框进行提示操作。通过调整数据展示方式,优化了用户体验,确保了信息的有效传递。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.跳转界面

//            jrspxsViewController *jrspxsVC=[[jrspxsViewController alloc] initWithNibName:@"jrspxsViewController" bundle:nil];

//            [self presentViewController:jrspxsVC animated:YES completion:nil];

//            [jrspxsVC release];

            

            //存储用户名

            NSUserDefaults *user=[NSUserDefaultsstandardUserDefaults];

            [usersetValue:qqTextforKey:@"UserName"];

            indexViewController *indexVC=[[indexViewControlleralloc]initWithNibName:@"indexViewController"bundle:nil];

            //返回上一个界面

            UINavigationController *nav=[[UINavigationControlleralloc]initWithRootViewController:indexVC];

            

            [selfpresentViewController:nav animated:YES completion:nil];

            [indexVCrelease];

            [navrelease];

2.


- (void)viewDidLoad

{

    [superviewDidLoad];

    //添加back按钮返回上一个界面

    UIBarButtonItem *leftbtn=[[UIBarButtonItemalloc]initWithTitle:@"back"style:UIBarButtonItemStyleBorderedtarget:selfaction:@selector(buttonBack)];

    self.navigationItem.leftBarButtonItem=leftbtn;

    [leftbtnrelease];

}

-(void)buttonBack{

    [selfdismissViewControllerAnimated:YEScompletion:nil];

}

3.弹出对话框

UIAlertView *alter=[[UIAlertViewalloc]initWithTitle:@"登陆成功" message:@"" delegate:nilcancelButtonTitle:nilotherButtonTitles:@"确定登陆",nil];

            [alter show];

            [alter release];

4.取用户名和空出一行Label

之前:

- (void)viewDidLoad

{

    [superviewDidLoad];

    self.tableView=[[UITableViewalloc]  initWithFrame:self.view.bounds];

    self.tableView.dataSource=self;

    self.tableView.delegate=self;

    [self.view addSubview:self.tableView];

之后:

- (void)viewDidLoad

{

   // NSString *pwdText = _pwd.text;

    [superviewDidLoad];

    NSUserDefaults *user=[NSUserDefaultsstandardUserDefaults];

    NSString *name=[user objectForKey:@"UserName"];

//距离顶部有30的距离

    self.tableView=[[UITableViewalloc]  initWithFrame:CGRectMake(0,30,self.view.bounds.size.width,self.view.bounds.size.height-30)];

    self.tableView.dataSource=self;

    self.tableView.delegate=self;

    [self.view addSubview:self.tableView];

5.取数据

之前显示一行:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{

    static NSString *cellIdentifier=@"cellIdentifier";

    UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:cellIdentifier];

    if (cell==nil) {

        cell=[[[UITableViewCellalloc]initWithStyle:UITableViewCellStyleDefaultreuseIdentifier:cellIdentifier]autorelease];

    }

    NSDictionary *dic=[self.listDataobjectAtIndex:indexPath.row];

    cell.textLabel.text=[dicobjectForKey:@"dept"];

    return cell;

}

之后显示二行:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{

    static NSString *cellIdentifier=@"cellIdentifier";

    UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:cellIdentifier];

    if (cell==nil) {

        cell=[[[UITableViewCellalloc]initWithStyle:UITableViewCellStyleValue1reuseIdentifier:cellIdentifier]autorelease];

    }

    NSDictionary *dic=[self.listDataobjectAtIndex:indexPath.row];

    cell.textLabel.text=[dicobjectForKey:@"fd"];

    cell.detailTextLabel.text=[dicobjectForKey:@"ssj"];

    return cell;

}

-------------------------------------------------------------------------------------------------------------------------------------------

//- (void)login {

//    NSString *qqText = _qq.text;

//    NSString *pwdText = _pwd.text;

//    

//    NSLog(@"QQ=%@,密码=%@", qqText, pwdText);

//    [self.view endEditing:YES];// 如果第一响应者存在于self.view里面,就可以退出键盘

//    //传递参数

//    NSMutableArray *params=[NSMutableArray array];

//    //[params addObject:[NSDictionary dictionaryWithObjectsAndKeys:@"pass",@"dm", nil]];

//    //[params addObject:[NSDictionary dictionaryWithObjectsAndKeys:@"lfxpass2010",@"pwd", nil]];

//    //设置传递对象

//    ServiceArgs *args=[[[ServiceArgs alloc] init] autorelease];

//    

//    args.methodName=@"selectJjtz";

//    

//    args.soapParams=params;

//    

//    //调用

//    

//    [[ServiceHelper sharedInstance] asynService:args completed:^(NSString *xml, NSDictionary *userInfo) {

//        NSLog(@"xml=%@\n",xml);

//    } failed:^(NSError *error, NSDictionary *userInfo) {

//        NSLog(@"error=%@\n",[error description]);

//    }];

//}



觉得写得不错,帮忙打赏下,谢谢!

内容概要:《学术研究提示设计 50 招》是一份详尽的指南,旨在帮助研究人员提高学术写作和研究效率。该文档涵盖了从论文撰写、润色、翻译、查重降重、参考文献管理、投稿审稿到文献阅读等多个方面的具体操作指令。每一章节均针对特定任务提供了详细的步骤和注意事项,例如如何撰写标题、摘要、致谢,如何进行英文润色、中英翻译,以及如何优化逻辑结构等。文档还介绍了如何利用AI工具进行文献分析、术语表提取和研究方向探索等内容,为研究者提供了全面的支持。 适合人群:适用于学术研究人员,特别是那些需要撰写、润色和提交学术论文的研究者,包括研究生、博士生及高校教师等。 使用场景及目标:① 提供一系列具体的指令,帮助研究者高效完成论文的各个部分,如撰写标题、摘要、致谢等;② 提供润色和翻译的详细指导,确保论文语言的准确性和专业性;③ 提供查重降重的方法,确保论文的原创性;④ 提供参考文献管理和投稿审稿的指导,帮助研究者顺利发表论文;⑤ 利用AI工具进行文献分析、术语表提取和研究方向探索,提高研究效率。 阅读建议:此资源不仅提供了具体的指令和方法,更重要的是引导研究者如何思考和解决问题。因此,在学习过程中,不仅要关注具体的步骤,还要理解背后的原理和逻辑,结合实际案例进行实践和反思。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值