`

something

 
阅读更多

 

#import <uikit> 

@class somethingViewController;

@interface somethingAppDelegate : NSObject <uiapplicationdelegate> 
{
    UIWindow *window; 
    somethingViewController *viewController; 
} 

@property (nonatomic, retain) IBOutlet UIWindow *window; 
@property (nonatomic, retain) IBOutlet somethingViewController *viewController;

@end

 

#import "somethingAppDelegate.h" 
#import "somethingViewController.h" 

@implementation somethingAppDelegate 
      @synthesize window; 
      @synthesize viewController;

  - (void)applicationDidFinishLaunching:(UIApplication *)application { 
          // Override point for customization after app launch 
          [window addSubview:viewController.view];
          [window makeKeyAndVisible];

     } 

  - (void)dealloc { 
           [viewController release]; 
           [window release];
           [super dealloc]; 
      } 

    @end  

 

 

 

 #import <uikit> 

 @interface somethingViewController : UIViewController <uiactionsheetdelegate> 
   {
       IBOutlet UITextField *name; 
       IBOutlet UITextField *pwd; 
       IBOutlet UISlider *slider;
       IBOutlet UILabel *label; 
       IBOutlet UISegmentedControl *segmentControl; 
       IBOutlet UIView *swithView; 
       IBOutlet UISwitch *leftSwitch; 
       IBOutlet UISwitch *rightSwitch;
       IBOutlet UIButton *button;
  }

@property (nonatomic ,retain) UITextField *name ;
@property (nonatomic,retain) UITextField *pwd;
@property (nonatomic,retain) UISlider *slider;
@property (nonatomic,retain) UILabel *label; 
@property (nonatomic,retain) UIButton *button;
@property (nonatomic,retain) UISegmentedControl *segmentControl;
@property (nonatomic,retain) UIView *swithView; 
@property (nonatomic,retain ) UISwitch *leftSwitch; 
@property (nonatomic,retain) UISwitch *rightSwitch;

-(IBAction) textFieldDoneEditing:(id) sender;
-(IBAction) sliderChange:(id) sender;
-(IBAction ) segmentChange:(id) sender; 
-(IBAction ) buttonDoneEditing:(id) sender;
-(IBAction) swithChange:(id) sender; 
-(IBAction) buttonClick:(id) sender; 

@end 

 

 

 

#import "somethingViewController.h"

 @implementation somethingViewController

 @synthesize name; 
 @synthesize pwd; 
 @synthesize slider;
 @synthesize label;
 @synthesize swithView; 
 @synthesize segmentControl; 
 @synthesize rightSwitch; 
 @synthesize leftSwitch; 
 @synthesize button;

-(IBAction) textFieldDoneEditing:(id) sender{ 
      [sender resignFirstResponder]; 
   }

 -(IBAction ) buttonDoneEditing:(id) sender{ 
        [name resignFirstResponder]; 
        [pwd resignFirstResponder]; 
   }

-(IBAction) sliderChange:(id) sender{ 
        UISlider *s=(UISlider *)sender; 
        int intValue=(int)(s.value + 0.5f);
        NSString *v=[[NSString alloc] initWithFormat:@"%d",intValue];
        [label setText:v ];
        [v release]; 
    } 

-(IBAction ) segmentChange:(id) sender{ 
      UISegmentedControl *seg=(UISegmentedControl *) sender; 
      NSInteger segment=[seg selectedSegmentIndex]; 
      if(segment==0){
             [swithView setHidden:NO]; 
       }else { 
              [swithView setHidden:YES];
          }  
   } 


-(IBAction) swithChange:(id) sender{
         UISwitch *sw=(UISwitch *) sender; 
         BOOL setting= sw.isOn; 
         [leftSwitch setOn:setting animated:YES]; 
         [rightSwitch setOn:setting animated:YES];
 } 



-(IBAction) buttonClick:(id) sender{ 
  NSString *msg; 
  if([[name text] length] >0){ 
           msg=[[NSString alloc] initWithFormat:@"%@",[name text]]; 
     }
          else 
     {
         msg=@"elsefee-----";
      } 

UIActionSheet *actionSheet=[[UIActionSheet alloc] initWithTitle:@"titititiitititiltltltltl" 
                                                      delegate:self 
                                                                     cancelButtonTitle:msg 
                                                                                     destructiveButtonTitle:@"确认"  
                                                                     otherButtonTitles:@"other1",@"other2",@"other3",nil]; 
     [actionSheet showInView:self.view]; 
     [actionSheet release];
     [msg release]; 
} 



- (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex{ 
    NSLog(@"didDismissWithButtonIndex",buttonIndex); 
    NSLog(@"cancelbutton===%d",[actionSheet cancelButtonIndex]); 
    NSLog(@"----------------");

    UIAlertView *alert=[[UIAlertView alloc] initWithTitle:@"alerttttt"
                                                           message:@"message-------" 
                                                          delegate:nil 
                                                          cancelButtonTitle:@"cancelbutton" 
                                                         otherButtonTitles:@"oo1",@"oo2",@"oo33",nil];

   [alert show]; 
   [alert release]; 

}


/* 
// The designated initializer. Override to perform setup that is required before the view is loaded. 

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
          if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
                 // Custom initialization 
           } 
           return self; 
     } 

*/


 /* 
    // Implement loadView to create a view hierarchy programmatically, without using a nib. 
  - (void)loadView { 

            } 
 */



 /* 
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib. 
- (void)viewDidLoad { 
          [super viewDidLoad]; 
      } 

*/



 /* 
// Override to allow orientations other than the default portrait orientation. 

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 
        // Return YES for supported orientations 
         return (interfaceOrientation == UIInterfaceOrientationPortrait);
    } */ 

- (void)didReceiveMemoryWarning { 
      // Releases the view if it doesn't have a superview. 
       [super didReceiveMemoryWarning];
     // Release any cached data, images, etc that aren't in use. 
   }


 - (void)viewDidUnload { 
    // Release any retained subviews of the main view. 
   // e.g. self.myOutlet = nil;
  } 

- (void)dealloc { 
          [super dealloc];
          [name release];
          [pwd release]; 
          [label release]; 
          [slider release];
          [swithView release]; 
          [leftSwitch release]; 
          [rightSwitch release];
          [segmentControl release]; 
          [button release];
  }

 @end

 

分享到:
评论

相关推荐

    20bn-something-something-v2-00.zip

    视频处理,行为识别公开数据集,20bn-something-something-v2-00.zip。v2-00~v2-19 基于RGB的Action Recognition相关的实验,频繁的使用到了Something-Something数据集; Something数据集是一个大型的带有标签的记录...

    Something

    "Something"这个主题可能涉及到了字体设计的创新、字体在不同场景的应用以及如何通过字体提升设计品质等多个方面。 【描述】:深入探讨字体的美学价值和实用功能,从传统印刷到数字媒体,从基础的宋体、黑体到个性...

    解决On no!Something has gone wrong.

    Something has gone wrong." 是一个常见的错误提示,通常表示系统遇到了问题或有软件运行异常。解决这个问题需要一系列步骤,包括诊断错误来源、修复相关组件和确保系统的稳定运行。以下是一些相关的Linux知识和...

    something need to download

    "something need to download"这个标题暗示了我们可能正在处理一个涉及下载过程的问题或者资源。描述中的重复内容可能是由于输入错误,没有提供足够的具体信息,所以我们需要基于一般的下载流程来探讨相关知识点。 ...

    something.rar

    压缩文件"something.rar"的出现,为我们提供了一个深度学习项目所需的数据集,其中包含了两个版本的配置文件和三组重要的CSV文件——训练集、测试集和验证集,这些都是深度学习实践者在开发和评估模型时不可或缺的...

    如何解决ChatGPT常见的错误信息Something went wrong

    如何解决ChatGPT常见的错误信息Something went wrong

    GitHub 读取jupyter报错Sorry, something went wrong. Reload?

    GitHub 读取jupyter报错Sorry, something went wrong. Reload?

    如何解决ChatGPT常见的错误信息Something went wrong.zip

    如何解决ChatGPT常见的错误信息Something went wrong.zip

    something wrong,trouble--test

    "something wrong,trouble--test" 的标题暗示可能存在错误或故障,并且正在通过测试进行排查。虽然描述部分没有提供具体信息,但我们可以根据标签和压缩包内的文件名称来推测一些可能的知识点。 【标签】"new" 可能...

    Data Points Visualization That Means Something数据之美 一本书学会可视化设计 英文版

    - **书名**:《Data Points Visualization That Means Something 数据之美:一本书学会可视化设计》(英文版) - **作者**:Nathan Yau - **出版社**:John Wiley & Sons, Inc. - **出版年份**:2013年 - **ISBN**:...

    commons something

    标题中的"commons something"指的是Apache Commons项目,这是一个Java编程语言的开源库集合,提供了许多实用的组件和服务。Apache Commons是Apache软件基金会的一部分,致力于开发和维护一系列小型、实用的类库,以...

    something important

    【标题】:“something important”可能是指某个重要的IT项目或技术讨论,但由于提供的信息有限,我们需要通过其他途径获取更具体的上下文。在这个情况下,我们可以聚焦于“源码”和“工具”这两个标签,来探讨在...

    Algorithm-Learn-Something-Every-Day.zip

    Algorithm-Learn-Something-Every-Day.zip,我所学的所有东西的汇编;计算机科学,软件开发,工程,数学,以及一般的编码。在这里阅读渲染结果-&gt;,算法是为计算机程序高效、彻底地完成任务而创建的一组详细的准则。

    插件something

    这是一个插件something,非常好用。

    tema.rar_Something About You

    【标题】"tema.rar_Something About You" 提到的主题涉及到创建和管理动物园的相关知识,而"Something About You"可能是指个人在这个过程中的角色或特殊经验。从描述中我们可以推测,这个压缩包可能包含了关于如何...

    something等于某物吗?.doc

    在探讨"something等于某物吗?"这个问题时,我们需要深入理解这个英文单词在不同语境下的含义和用法。"something"在英语中通常被译为"某事"或"某物",但它并不是一个简单的代词,其内涵可以根据上下文而变化。在某些...

    migong.rar_Something About You

    标题 "migong.rar_Something About You" 暗示我们关注的是一个关于编程学习的压缩包,特别是C和C++语言,以及它们在数据结构方面的应用。描述中提到的 "c and c++ through it you will realize something about data...

    BCJR.rar_See Something_bcjr

    在给定的标题"BCJR.rar_See Something_bcjr"中,“See Something”可能是指通过BCJR算法解析或理解某种序列数据。 BCJR算法的核心在于提供了一个高效的方法来计算给定观测序列下HMM的状态路径的概率。它在语音识别...

Global site tag (gtag.js) - Google Analytics