• 工作日志(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);

  • 相关阅读:
    并查集-B
    ->的用法
    PTA-1042 字符统计
    PAT 1040有几个PAT
    assembly x86(nasm)修改后的日常
    python接口自动化之操作常用数据库mysql、oracle
    os模块常用方法
    python 多线程编程并不能真正利用多核的CPU
    连接mysql数据库
    python之用yagmail模块发送邮件
  • 原文地址:https://www.cnblogs.com/alihaiseyao/p/3394860.html
Copyright © 2020-2023  润新知