Time of Update: 2013-12-02
將Json存進本地檔案夾NSArray *paths=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *path=[paths objectAtIndex:0]; NSString *Json_path=[path stringByAppendingPathComponent:@"JsonFile.json"];
Time of Update: 2013-11-16
1、用戶端編程推播通知技術在Mac OS X和iOS系統上都可以運行,我們本章主要介紹iOS用戶端編程,推播通知的編程比較簡單,編程的關鍵是獲得令牌,這是從APNS返回的,然後還有把提交給內容供應商。下面我們看看開發之前的一些準備工作。 配置Xcode工程編寫iOS推送應用需要在Xcode工程中進行一些配置,這些配置是主要是設定程式碼簽署標識,程式碼簽署標識的前提要有配置概要檔案(Provisioning Profiles)。有了配置概要檔案即可以設定程式
Time of Update: 2013-12-02
許多第三方提供的.a檔案(一般是那些SDK),嵌入到我們的xcode項目後,產生不會報錯。 一部分粗心的SDK提供方,或者我們自己做的.a檔案,就會有報錯,常見的就是不是armv7結構,或者不是armv7s結構,如果在模擬器中運行,會報不是i386結構。 原因是:armv7是支援比iphone5舊的那些裝置,armv7s是iphone5或ipad4或者以後的新裝置,i386是mac的。 這些名字指的是處理器所用的指令集。 因此常常發生的是.a檔案要麼ipa
Time of Update: 2013-12-02
//擷取一個視圖的快照- (UIImage *)getImageFromView:(UIView *)view{ float width = [UIScreen mainScreen].bounds.size.width; float height = [UIScreen mainScreen].bounds.size.height; UIGraphicsBeginImageContext(CGSizeMake(width, height));
Time of Update: 2013-11-16
http://download.csdn.net/detail/tonny_guan/5419117 http://download.csdn.net/detail/tonny_guan/5419123204462948http://weibo.com/516inc 作 者:關東升出 版 社:清華大學出版社出版時間:2013-5-1 版 次:1 頁
Time of Update: 2013-11-16
配置推播通知比較麻煩,需要iOS開發人員帳號,然後配置一個Apple ID、配置概要檔案和SSL認證。 1 認證簽章要求首先需要認證簽章要求,這需要在Mac OS X系統中完成,通過在系統中選擇“工具 +
Time of Update: 2013-11-16
Unable to create any keyboard shortcuts after the iOS 6.1.3 update on iPad 3I had two keyboard shortcuts on my device before updating to iOS 6.1.3. After the update I wanted to create two more keyboard shortcuts but I am not able to do so as the
Time of Update: 2013-11-16
1、更換壁紙:把圖片寫到這個目錄,/var/mobile/Library/LockBackground.jpg,然後kill the Springboard.2、把程式添加進通知中樞(iOS5以上),把.bundle檔案放入System/Library/WeeAppPlugins目錄下。進入設定-通知中樞,就有此程式了。3、越獄開發的人知道,theopendev開發的時候,經常碰到這個問題:dpkg: error: dpkg status database is locked by
Time of Update: 2013-11-16
iphone5出來了,從不用適配的我們也要像android一樣適配不同解析度的螢幕了。 公司產品新版本需要適配iphone5,經過一番折騰算是搞定了。下面分享給大家: iphone5的螢幕解析度:1136 x 640
Time of Update: 2013-11-16
block是可以捕捉內容相關的特殊代碼塊。block可以訪問定義在block外的變數,當在block中使用時,它就會為其在範圍內的每個標量變數建立一個副本。如果通過self擁有一個block,然後又在block中改變了執行個體變數,就會出錯。例如: self.block = ^(NSString * self.aLabel.text =
Time of Update: 2013-11-16
1. 讀寫屬性(readwrite/ readonly)
Time of Update: 2013-11-16
寫了一個類似魔獸小地圖功能的控制項。比如你有一個可以放大縮小的scrollView。會在裡面進行一些放大縮小,點擊裡面的按鈕呀,等操作。這個小地圖控制項。就會和你的大scrollView同步。並有縮圖和你當前視口的位置。就像遊戲裡那樣。看圖。 SmallMapView.h <UIKit/UIKit.h> <QuartzCore/QuartzCore.h>@property (nonatomic,assign,)@property
Time of Update: 2013-11-16
訊息機制 NSNotificationCenter 一直都在頻繁使用,但是卻對其原理不是十分瞭解。今天就花些時間,把訊息機制原理重頭到尾好好過一遍。iOS 提供了一種 "同步的" 訊息通知機制,觀察者只要向訊息中心註冊,
Time of Update: 2013-11-16
UIDevice //裝置相關資訊的擷取 NSString *strName = [[UIDevice currentDevice] name]; NSLog(@"裝置名稱:%@", strName);//e.g. "My iPhone" NSString *strId = [[UIDevice currentDevice] uniqueIdentifier]; NSLog(@"裝置唯一標識:%@", strId);//UUID,5.0後不可用
Time of Update: 2013-11-16
There are some great changes in 2.0 version.Console in tutorial:In previous version, there will be console tool in render result. You can input some js code and run in result page. Just just debug tool of chrome.And in 2.0 version, user can enable a
Time of Update: 2013-11-16
程式中需要打分的功能,在網上找了幾個,都不是很滿意。下面是實現出的效果。可以點擊,可以拖動。 使用方法:初始化控制項。 TQStarRatingView *starRatingView = [[TQStarRatingView alloc] initWithFrame:CGRectMake(, , , ) numberOfStar: =實現一個委託函數-()starRatingView:(TQStarRatingView *)view score:(= [NSString
Time of Update: 2013-10-28
Automatic Reference Counting (ARC),自動引用計數,是開發Cocoa程式時的一個編譯層級的特性,用於自動記憶體管理。 1:在XCode 4.2中,使用模板建立一個工程,該工程將”預設“選擇使用ARC特性 2:對於已經建立好的項目可以 選中項目, Building Settings, 然後找到 Objective C Automatic Reference Counting(找不到,可以搜尋到), 設定改為No
Time of Update: 2013-10-28
基礎部分 1: 圖片記憶體大小小結 a: 圖片:是佔用記憶體的大戶,尤其是手機遊戲圖片資源眾多。對圖片資源在記憶體中佔用量的計算成為J2ME遊戲開發人員的經常性工作,CoCoMo來解釋一下如何計算圖片在記憶體中的佔用量:記憶體佔用量=寬*高*像素位元組數,其中像素位元組數因機型而異。 例如一張64*64的圖片在7210上的記憶體佔用量=64*64*1.5=6144(位元組)=6K、在S60上的記憶體佔用量=64*64*2=8192 (位元組)=8K。像素位元組數因機型而異,例如 721
Time of Update: 2013-10-28
#import "ViewController.h"@interface ViewController (){UITableView *_table;NSMutableArray *_dataList;UIView *footView;}@end@implementation ViewController- (void)viewDidLoad{[super viewDidLoad];_table=[[UITableView alloc]initWithFrame:
Time of Update: 2013-10-28
[tableView reloadData];可以將整個tableview的資料重新整理,但有些時候我們可能只更改了某一行或多行的資料,不想全部重新來過,怎麼辦呢?這就要用到下面這個方法了。- (void)reloadRowsAtIndexPaths:(NSArray *)indexPaths withRowAnimation:(UITableViewRowAnimation)animation NS_AVAILABLE_IOS(3_0);範例程式碼如下:NSIndexPath