在viewDidLoad中初始化需要的子控件,然后提供改变这些子控件的开放接口,然后使用一个bool变量来保存是否已经设置了子类控件的frame类似-(void)layoutSubviews{ [super layoutSubviews];#pragma mark 这个变量很重要,如果没有...
分类:
其他好文 时间:
2014-11-13 18:39:59
阅读次数:
194
#pragma mark - UISearchBarDelegate//当搜索文本被改变的时候调用- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText{ //改变searchControlle....
分类:
其他好文 时间:
2014-11-13 18:09:35
阅读次数:
224
#pragma 画虚线 UIImageView *imageView1 = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 320, 640)]; imageView1.backgroundColor = [UIColor redColor];....
分类:
移动开发 时间:
2014-11-13 12:35:30
阅读次数:
209
这个内存对齐问题,居然影响到了sizeof(struct)的结果值。突然想到了之前写的一个API库里,有个API是向后台服务程序发送socket请求。其中的socket数据包是一个结构体。在发送socket之前,会检测数据的长度;服务端接收到数据后也会检测长度。如果说内存对齐问题影响到了结构体的si...
分类:
编程语言 时间:
2014-11-12 22:36:33
阅读次数:
564
#pragma mark 截图
- (UIImage *)capture:(UIView *)view
{
UIGraphicsBeginImageContextWithOptions(view.bounds.size, YES, 0.0);
[view.layer renderInContext:UIGraphicsGetCurrentContext()];
U...
分类:
移动开发 时间:
2014-11-12 19:47:11
阅读次数:
200
#import #pragma mark 初始化字符串void initStr() { //1.init NSString *str1 = [[NSString alloc ]init];//不可改变的空字符串 无意义 NSString *str2 = [NSString stri...
分类:
其他好文 时间:
2014-11-12 00:14:15
阅读次数:
391
#pragma once #include using namespace std;#define MAX_CHAR 26struct node { bool isWord; node* next[MAX_CHAR]; node() { isWord = false; for(int i = 0.....
分类:
其他好文 时间:
2014-11-11 16:19:55
阅读次数:
214
转载请注明出处!!输入一个BMP文件,输出一个文本图形, 1 #include 2 #include 3 4 #pragma pack(1) 5 struct BMPFILEHEADER //BMP头文件 6 { 7 short bfType; 8 int...
分类:
其他好文 时间:
2014-11-10 19:31:16
阅读次数:
256
#pragma mark - Core Data Methods- (void)insertObjectWithFileName:(NSString *)fileName{ /** SQL新增记录的过程 1. 拼接一个INSERT的SQL语句 2. 执行SQL */ // 1. 实例化并...
分类:
移动开发 时间:
2014-11-09 16:36:58
阅读次数:
199
题意:
#pragma comment(linker, "/STACK:1024000000,1024000000")
#include
#include
#include
#include
template
inline bool rd(T &ret) {
char c; int sgn;
if (c = getchar(), c == EOF) return 0...
分类:
其他好文 时间:
2014-11-09 15:19:46
阅读次数:
242