原创 MySql字符串處理
對於針對字符串位置的操作,第一個位置被標記爲1。 1.ASCII(str) 返回字符串str的最左面字符的ASCII代碼值。如果str是空字符串,返回0。如果str是NULL,返回NULL。 mysql> select ASCII
原创 Sizes of iPhone UI Elements
Sizes of iPhone UI Elements Element Size (in points) Window (including status bar) 320 x 480 pts Status Bar(How to hide
原创 iPhone讀取網頁內容亂碼解決方案
讀取的中文網頁編碼集是gb2312,進行如下轉換可正常顯示中文: NSString *urlStr="your url"; NSURL *url = [NSURL URLWithString:urlStr]; NSData *data =
原创 iOS推送消息實現
向iPhone、iPod Touch發送消息都需要認證的,下面是以向iPhone推送消息: 一、開通“Apple Push Notification Service” 1.進入 Provisioning Protal 2.選擇Ap
原创 tomcat關不掉的原因
http://tuhaitao.iteye.com/blog/1122935 tomcat/bin 目錄下的catalina.sh是比較常用的shell Shell代碼 #啓動tomcat ./catal
原创 設置圓角
#import <QuartzCore/QuartzCore.h> icon.layer.masksToBounds = YES; icon.layer.cornerRadius = 5.0;
原创 SDWebImage回調
[cell.imageView setImageWithURL:[NSURL URLWithString:@"http://www.domain.com/path/to/image.jpg"] placeho
原创 iOS延時執行的幾種方法
1. 最直接的方法performSelector:withObject:afterDelay: 這種方法的缺點:每次要爲延時寫一個方法 2. @implementation NSObject (PerformBlockAfte
原创 objective-c 前後去空格,去行
NSString* str = @" \n\n\n\n\n string\nstring \n \n \n "; NSString* str2 = [str stringByTrimmingCharactersIn
原创 ios gb2312轉utf-8
+(NSString *) gb2312toutf8:(NSData *) data{ NSStringEncoding enc = CFStringConvertEncodingToNSStringEncoding(kCFS
原创 iPhone – Configuring the AVAudioSession and Output Audio to iPhone Speaker
http://eureka.ykyuen.info/2010/06/02/iphone-configuring-the-avaudiosession-and-output-audio-to-iphone-speaker/ iPh
原创 查看tomcat進程與Killtomcat
ps -aux | grep tomcat kill -9 tomcat-pid 點贊 收藏 分享 文章舉報 peterpansh 發佈了82 篇原創文章 · 獲贊 6 ·
原创 判斷用戶設備是iPad還是iPhone的代碼
#define isPad (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) 點贊 收藏 分享 文章舉報
原创 Notification
appDelegate裏面:-(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo; 通
原创 如何啓用長按事件
UILongPressGestureRecognizer *longPressGR = [[UILongPressGestureRecognizer alloc] initWithTarget:self