Git Product home page Git Product logo

ios-learning's People

Contributors

here-we-goal avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

ios-learning's Issues

UITextField 与 键盘的关闭

loadView内代码创建了一个textField,头文件内并没有声明
添加到view中

然后需要对呼出的键盘做一下关闭功能的配置
网上找了一圈,差不多就是在两种场景下需要关闭键盘
一是点击键盘上的return键,一是点击textField以外的区域

- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
    [textField resignFirstResponder];
    return YES;
}
// 触摸背景,关闭键盘
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    UITouch *touch = [touches anyObject];
    UIView *view = (UIView *)[touch view];
    NSLog(@"touch");
    if(view == self.view){
       // 如果textField使用局部对象,这里就需要采用ViewWithTag的方式来取到textView。从前端的角度来说可能是类似于dom选择器。
       // 更好的方法是将textField控件再头文件进行声明。这样性能更好,代码简洁
        // [self.textField resignFirstResponder];
    }
}

UITableView Crashed

    self.tableView.dataSource = self;
    self.tableView.delegate = self;

这两句在代码中出现警告提示:
~/IosSpace/Start/Start/ListViewController.m:57:31: Assigning to 'id' from incompatible type 'ListViewController *const __strong'

修改ListViewController.h文件中
@interface ListViewController : UIViewController

@interface ListViewController : UITableViewController后警告消失

但是在编译后模拟器中打开这个Controller时崩溃

JSONKit

IOS对JSON数据的处理,大多推荐JSONKit
https://github.com/johnezang/JSONKit

iOS Jsonkit 用法简要说明
http://blog.csdn.net/w237or45/article/details/7827796

不过放到工程里之后显示一串error


  • 由于JSONKit没有使用ARC,所以使用时不要忘了在build phases -》compile sources 选择文件后面加-fno-objc-arc参数。
  • Xcode升级出现的警告
array->isa = _JKArrayClass; 改成 object_setClass(array, _JKArrayClass);

dictionary->isa = _JKDictionaryClass; 改成 object_setClass(dictionary, _JKDictionaryClass);
#pragma clang diagnostic push
#pragma clang diagnostic ignored"-Wdeprecated-objc-pointer-introspection"
BOOL workAroundMacOSXABIBreakingBug = (JK_EXPECT_F(((NSUInteger)object) &0x1)) ? YES : NO;
#pragma clang diagnostic pop
//BOOL workAroundMacOSXABIBreakingBug = (JK_EXPECT_F(((NSUInteger)object) & 0x1))     ? YES  : NO;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.