Time of Update: 2015-04-09
iOS 圖片存到沙箱- (void)viewDidLoad {[super viewDidLoad];//初始化一個載入圖片的試圖imageview=[[UIImageView alloc]initWithFrame:CGRectMake(0, 50, self.view.frame.size.width, self.view.frame.size.height-100)];[self.view
Time of Update: 2015-04-09
(轉)怎麼去掉Xcode工程中的某種類型的警告 Implicit conversion loses integer precision: 'NSInteger' (aka 'long') to
Time of Update: 2015-04-08
iOS 網路基礎,ios網路基礎iOS 網路基礎一次HTTP請求的完整過程 瀏覽器/應用 發出請求(請求包含HTTP請求(GET,POST),地址URL,協議(HTTP/1.1),要求標頭部,附加資訊) --> Web服務端處理(頁面:靜態html頁面、動態php/asp/jsp頁面) -->
Time of Update: 2015-04-08
(轉 部分修改) IOS 手勢密碼(簡單版),ios手勢//// Created by wangtouwang on 15/4/7.// Copyright (c) 2015年 wangtouwang. All rights reserved.//#import <UIKit/UIKit.h>@class YYLockView;@protocol YYLockViewDelegate <NSObject>//自訂一個協議 //協議方法,把當前視圖作為參數
Time of Update: 2015-04-07
Unicode轉化為漢字,Unicode轉化漢字+ (NSString *)replaceUnicode:(NSString *)unicodeStr { NSString *tempStr1 = [unicodeStrstringByReplacingOccurrencesOfString:@"\\u"withString:@"\\U"]; NSString *tempStr2 =
Time of Update: 2015-04-08
[IOS 開發] UIImage改變像素值- (UIImage*) imageBlackToTransparent:(UIImage*) image{ // 分配記憶體 const int imageWidth = image.size.width; const int imageHeight = image.size.height; size_t bytesPerRow = imageWidth * 4; uint32_t* rgbImageBuf =
Time of Update: 2015-04-06
Cocoa cola——Cocoa
Time of Update: 2015-04-06
iOS擷取檔案和檔案夾大小,ios擷取檔案夾//通常用於刪除緩衝的時,計算緩衝大小//單個檔案的大小- (long long) fileSizeAtPath:(NSString*) filePath{ NSFileManager* manager = [NSFileManager defaultManager]; if ([manager fileExistsAtPath:filePath]){ return [[manager
Time of Update: 2015-04-05
iOS多線程總結,ios多線程1.不要同時開太多的線程(1~3條線程即可,不要超過5條)2.線程概念1> 主線程 : UI線程,顯示、重新整理UI介面,處理UI控制項的事件2> 子線程 : 後台線程,非同步線程3.不要把耗時的操作放在主線程,要放在子線程中執行 一、NSThread(掌握)1.建立和啟動線程的3種方式1> 先建立,後啟動// 建立NSThread *thread = [[NSThread alloc] initWithTarget:self
Time of Update: 2015-04-08
iOS學習之WebView的使用1、初始化WebView- (void)viewDidLoad{[super viewDidLoad];webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];NSURLRequest *request =[NSURLRequest requestWithURL:[NSURL URLWithString:@http://www.baidu.com]];[self.view
Time of Update: 2015-04-05
iOS開發之XML解析,iosxml解析iOS開發之XML解析1.XML格式結構:層層嵌套的樹形結構<?xml version="1.0" encoding="utf-8" ?>1.0 表示XML檔案版本, utf-8 表示 內部文本使用的編碼<root> 表示根節點<CityName>北京</CityName> 一個結點, CityName是結點名, 北京結點值<Item key="1"
Time of Update: 2015-04-04
IOS 執行動畫後想要調用某個方法第一種方法:,使用監聽 UIView beginAnimations方法如下: [UIView beginAnimations:nil context:nil]; //代理,監聽對象 [UIView setAnimationDelegate:self]; //removeCover 是動畫執行完後要調用方法 [UIView setAnimationDidStopSelector:@selector(
Time of Update: 2015-04-05
iOS開發之單例模式,iOS開發之模式iOS開發之單例模式 在iOS開發中,有很多地方都選擇使用單例模式。有很多時候必須要建立一個對象,並且不能建立多個,用單例就為了防止建立多個對象。單例模式的意思就是某一個類有且只有一個執行個體。單例模式確保某一個類只有一個執行個體,而且自行執行個體化並向整個系統提供這個執行個體。一、單例模式的三要點: 1. 該類有且只有一個執行個體; 2. 該類必須能夠自行建立這個執行個體; 3.
Time of Update: 2015-04-04
iOS開發一行代碼系列:一行搞定資料庫原理iOS 和 SQL的對應關係Model類結構 => SQL表結構Model執行個體 => SQL表中的一行Model執行個體的屬性 => SQL表中的一列 Model和Table的對應 @interface TestModel :NSObject@property (assign, nonatomic) NSInteger age;@property (assign, nonatomic) CGFloat
Time of Update: 2015-04-04
iOS網路資料下載和JSON解析,ios網路json解析iOS網路資料下載和JSON解析簡介 在本文中筆者將要給大家介紹iOS中如何利用NSURLConnection如何從網路中下載資料,如何解析下載下來的JSON資料格式,以及如何顯示資料和圖片的非同步下載顯示。 涉及到的知識點: 1.NSURLConnection非同步下載和封裝#import "ZJHttpRequest.h"//消除performSelector的警告#pragma clang diagnostic ignored
Time of Update: 2015-04-04
如何iOS6和iOS7下隱藏UITabBar不栽跟頭,你就不會進步!這兩天適配iOS6,在UITabBar隱藏後原地區不響應點擊事件的問題上裹足不前,異常上火(不用心,就會這樣)!對於iOS7而言,隱藏UITabBar很容易:self.tabBarController.tabBar.hidden =
Time of Update: 2015-04-04
iOS開發之類別、擴充類別:在ios項目開發中允許使用類別為現有的類添加新的方法,並不需要建立子類。通過類別我們可以動態地為現有的類添加新的方法,可以將類的定義模組化地布局到多個相關檔案中。使用類別的好處為:一、進行模組化設計二、利用類別來調用私人方法介面部分格式如下:@interface 已有類 (類別名)//方法的定義.....@end注意:類別中通常只定義新的方法。類別的實現部分的文法格式如下:@implmentation
Time of Update: 2015-04-04
NSString+Check, iOS 判斷手機號碼格式是否正確使用方法:建立一個繼承於NSString的類,再匯入NSString+Check.h標頭檔,通過判斷字串的屬性值(checkPhoneNumInput)YES or NO 即可。// NSString+Check.h// ics//// Created by Casystar on 15-4-2.// Copyright (c) 2015年 dong. All rights reserved.// #import
Time of Update: 2015-04-04
iOS 擷取目前時間並且顯示走在視圖上//// RootViewController.m// 時間戳記在走並且顯示Demo//// Created by Dubai on 15/4/2.// Copyright (c) 2015年 Dubai. All rights reserved.// #import "RootViewController.h" @interface RootViewController (){ UILabel
Time of Update: 2015-04-04
iOS常用設計模式——簡單工廠設計模式簡單工廠設計模式詳解簡單工廠設計模式詳解 基本概念 結構圖 經典的樣本 範例程式碼 優點 缺點