iOS
未读
iOS:如何在UITableView调用reloadData刷新结束后再同步执行后续操作
调用[tableView reloadData]时,系统并不会等待tableview更新结束后才执行后续代码,而是立即执行后续代码,然后异步地去计算scrollView的高度,获取cell等等。 但是我们又经常需要在tableview刷新结束后同步的执行某些操作,这个是一个隐藏的小坑,有时候稍不注意
iOS
未读
统计iOS工程代码行数
虽然说这是一件毫无意义的事,而且如果代码打成库,统计还不准确。。当时有时候就是需要统计,比如说现在这个时间节点。。 注意,对swift代码无效。。 # 这个是包含空格的
find . "(" -name "*.m" -or -name "*.mm" -name "*.xib" -or -name "
CMake 入门及常用变量指令手册
实战 参考《CMake Practice》。 项目目录结构 我们项目的名称为CRNode,假设我们项目的所有文件存放再~/workspace/CRNode,之后没有特殊说明的话,我们所指的目录都以此目录为相对路径。 我们的目录结构如下: ~/workspace/CRNode
├─ src
│
算法
未读
LeetCode 6 ZigZag Conversion(Z字转换)
The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font
算法
未读
LeetCode 106 Construct Binary Tree from Inorder and Postorder Traversal(由中序和后序遍历建立二叉树)
Given inorder and postorder traversal of a tree, construct the binary tree. Note: You may assume that duplicates do not exist in the tree. For example
算法
未读
LeetCode 5 Longest Palindromic Substring(最长回文字串)
Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example 1: Input: "babad"
Output:
算法
未读
LeetCode 8 String to Integer (atoi)
Implement atoi which converts a string to an integer. The function first discards as many whitespace characters as necessary until the first non-white
iOS
未读
Objective-C Type Encodings
Objective-C Type Encodings 转自:nshipster,觉得再某些场景上有点用,就直接抄过来了。 @encode,@编译器指令 之一,返回一个给定类型编码为一种内部表示的字符串(例如,@encode(int) → i),类似于 ANSI C 的 typeof 操作。苹果的 O
iOS
未读
Objective-C:为什么分类中不能直接添加属性
为什么分类中不能直接添加属性,这个也是一个经典的面试题了。 搜了一些相关文章,再结合源码做了一个小小的总结。 其实通过这个问题,也可以一瞥 OC 中类的实现。 源码 先晒一下OC类和分类的部分源码: typedef struct objc_class *Class;
struct objc_cla