zoukankan      html  css  js  c++  java
  • 工作日志(10.29)

    虽然还是很艰难,首先对于别人写的类的熟悉程度太差,其次很多知识点其实懂得很浅,再次就是底层深入了解的太少。不过回顾这两天也学了不少东西,今天就整理下10.29日接手项目第二天的所见所学吧。

    @1  主要学到的语言系统的转换判断是不是英文状态

    //获取当前系统的语言

        NSUserDefaults* defs = [NSUserDefaults standardUserDefaults];

        NSArray* languages = [defs objectForKey:@"AppleLanguages"];

        NSString* preferredLang = [languages objectAtIndex:0];

        [mUsernameSmLabel setTextAlignment:UITextAlignmentRight];

        [mUsernameLabel setTextAlignment:UITextAlignmentCenter];

       

        //英文状态下修改相应的显示

        if ([preferredLang isEqualToString:@"en"])

        {

            [mUsernameLabel setText:@"Regist"];

            [mUsernameSmLabel setText:@"UseName:"];

            [mNoteLabel setText:@"Note: please use your mail as your user name and make sure you enter mailbox available, when you forget the password when this mailbox is your only way to retrieve the password!"];

            [mPwdLabel setText:@"Pwd:"];

            [mPwdLabel setTextAlignment:UITextAlignmentRight];

            [mPwdAgainLabel setText:@"RepPwd:"];

            [mPwdAgainLabel setTextAlignment:UITextAlignmentRight];

            [mRegBtn setTitle:@"regist" forState:UIControlStateNormal];

            [mBackBtn setTitle:@"back" forState:UIControlStateNormal];

        }

    @2  这句话主要用三木运算判断是不是iPhone5,以便于下一步操作

    #define IS_IPHONE5 (([[UIScreen mainScreen] bounds].size.height-568)?NO:YES)

    @3  这个主要是学到了如何使用UIAlertView

    UIAlertView *Aler=[[UIAlertView alloc] initWithTitle:NSLocalizedString(@"COMMON_ERROR",@"Error")

                                                             message: NSLocalizedString(@"UESREG_PLE_FILL_ALLL_INFO",@"Please fill in the information!")

                                                            delegate:self

                                                   cancelButtonTitle:NSLocalizedString(@"COMMON_OK", @"OK")

                                                   otherButtonTitles:nil, nil];

                [Aler show];

    [Aler release];

    @4

    // shows popup alert animated.

    - (void)show;

     

    当你想明确地(明确就是指用代码显式地)让alert消失,用来隐藏alert/sheet 弹出式的view.

    -      (void)dismissWithClickedButtonIndex:(NSInteger)buttonIndex animated:(BOOL)animated;

    @5  这里主要注意到当我们加载失败的时候也要释放内存,并且滞空

    - (void)viewDidUnload {

        [UserName release];

        UserName = nil;

    }

    @6  这里主要学到一种释放内存的方式 采用宏定义

    #define RELEASE_SAFELY(a) do {[a release]; a= nil;} while(0)

    @7  这里主要学到了UITextField需要加一个删除按钮在后面(我一时忘了)

       [userName setBorderStyle:UITextBorderStyleLine];

            [userName setClearButtonMode:UITextFieldViewModeWhileEditing];

            userName.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"login_edittext.png"]];

    @8获取跟控制器  主要学到了,如何在其他页面找到根控制器  然后在根控制器中启动一个主线程

        CasinEyeAppDelegate *delegate = (CasinEyeAppDelegate *)[[UIApplication sharedApplication] delegate];

        //[delegate toHiddenRequestActive];

        [delegate performSelectorOnMainThread:@selector(toHiddenRequestActive) withObject:nil waitUntilDone:NO];

    @9  这里主要学到了如何让UIAlertView显示在主线程中

    [alert performSelectorOnMainThread:@selector(show) withObject:nil waitUntilDone:NO];

    @10   主要学到了tableBarController切换子控制器

    - (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController NS_AVAILABLE_IOS(3_0);

  • 相关阅读:
    1029. Two City Scheduling
    JS判断Android、iOS或浏览器的多种方法(四种方法)【转】
    layui select onchange事件【转】
    PHP 判断数据类型【转】
    php 对数组进行排序【转】
    php中怎么删除数组的第一个元素和最后一个元素【转】
    php数组操作之获取数组元素索引(键)值【转】
    HTML表单中 textarea标签的value属性赋值【转】
    为什么js的"关联数组"不能转成json字符串而对象可以?【转】
    CSS white-space属性是用来设置如何处理元素中的空白【转】
  • 原文地址:https://www.cnblogs.com/alihaiseyao/p/3394860.html
Copyright © 2011-2022 走看看