10 2012 档案
摘要://1、系统的打电话代码,不返回当前程序: [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://10086"]]; //2、用UIWebView来实现,打电话结束后会返回当前应用程序: UIWebView *callPhoneWebVw = [[UIWebView alloc] init]; NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"tel://10086"
阅读全文
摘要://像这种控件的长按事件有些地方是有系统自带的。但有些时候用起来也不太方便。下面这个可能以后能用到UILongPressGestureRecognizer *longPressReger = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongPress:)]...
阅读全文
摘要://先要设Cell可编辑-(BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath{ NSLog(@"xxxxfffwefw"); return YES;}//修改编辑按钮文字- (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath{ return @"删除&q
阅读全文
摘要:// 要用到Reachability.h 和Reachability.m两个文件 -(void)checkNetworkRun { NSLog(@"newtwork44"); SchoolInHandAppDelegate *app = [[UIApplication sharedApplication]delegate]; Reachability *r = [Reachability reachabilityWithHostName:@"www.apple.com"]; switch ([r currentReachabilityStatus]) {
阅读全文
摘要:#include <stdio.h>int main(){ int a = 0; a = judged("8613775669854"); printf("%d\n",a);}int judged(char *str){ if(strlen(str)!=13 ) //手机号不为13 { return 1; } int i = 0; for(i = 0; i<13; i++) { if(str[i]<'0'|| str[i]>'9') //手机号中有非法字符 { return 2; ...
阅读全文
摘要://字体大小设置cell.resultTableContent.font = [UIFont systemFontOfSize:13];//最小字体设置。如果当内容比较多时。没有设置最小字体的话。那么这时字体就会变小。如果设置了最小字体和上面的大小 是一样的。那么字体就比较统一了。 cell.resultTableContent.minimumFontSize = 13.0;//设 置UItableViewCell里面 uilabel字体大小 自动适应。可以在这个方法里设置- (CGFloat)tableView:(UITableView *)tableView height...
阅读全文
摘要:- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ UITableViewCell *cell = [[UITableViewCell alloc]initWithFrame:CGRectMake(0, 0, 320, 30)]; cell.resultTableContent.highlightedTextColor = [UIColor blackColor]; //选中后的 颜色设置 cell.r...
阅读全文
摘要://首先添加framework------- libsqlite3.0.dylib//头文件#import "/usr/include/sqlite3.h" @interface ViewController : UIViewController<UIPopoverControllerDelegate, UISplitViewControllerDelegate>- (void)viewDidLoad{ [super viewDidLoad]; //打开 如果没有。则创建。 [self openDatabase]; //创建表 [self creat...
阅读全文