Time of Update: 2013-12-10
最近公司開發新項目,由於伺服器端在上海,iphone用戶端在瀋陽,因此溝通不通暢。之前都是通過xml格式發送資料到伺服器。因此在改為json後,發送經常不通過,後來通過尋找伺服器端錯誤log才知道,NSString *contentType = [NSString stringWithFormat:@"text/xml"];[request addValue:contentType forHTTPHeaderField: @"Content-Type"];
Time of Update: 2013-12-10
1、調用 內建mail[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"mailto://admin@hzlzh.com"]];2、調用 電話phone[[UIApplication sharedApplication] openURL:[NSURL
Time of Update: 2013-12-10
在viewdidload的時候,把每個TextField設好tag。之後就可以根據最下面的UITextField的內容來判斷鍵盤的彈出和關閉了 有的TextField* namename.tag = 2;下面就是當tag==2的情況下,才能夠把介面談到上面去。- (void)textFieldDidBeginEditing:(UITextField *)textField { //當點觸textField內部,開始編輯都會調用這個方法。textField將成為first
Time of Update: 2013-12-10
從實現上看上使用ADF的JBO來實現商務邏輯,通過HTML5 build 頁面。 看上去不錯,改天有空玩玩。Several unique aspects to Oracle ADF Mobile solution:Develop once run on many - same code base used for both iOS and Android applicaitonsUses Java - no need to learn device specific
Time of Update: 2013-12-10
很多時候我們都在為鍵盤遮擋了原本就不大的螢幕時而煩惱,特別是當使用者處於編輯狀態時,鍵盤下面的內容就看不見了,使用者只能處於盲打狀態了。現在有一種簡單的解決辦法,基本思路就是,添加通知。一直監聽鍵盤事件,在鍵盤遮擋時,將編輯器上移鍵盤的高度,鍵盤消失時,編輯區回複原來位置,ok,來兩段代碼吧[cpp] - (void)viewDidLoad { [super
Time of Update: 2013-12-10
iOS 支援多個層次的多線程編程,層次越高的抽象程度越高,使用起來也越方便,也是蘋果最推薦使用的方法。下面根據抽象層次從低到高依次列出iOS所支援的多線程編程範式:1, Thread;2, Cocoa operations;3, Grand Central Dispatch (GCD) (iOS4 才開始支援) 下面簡要說明這三種不同範式:Thread
Time of Update: 2013-12-10
服務端說明 #include <errno.h> //一些錯誤資訊的處理#include <stdio.h> // 標準輸入輸出#include <sys/types.h> &
Time of Update: 2013-12-10
使用協議委託任務協議是一個聲明某些方法及屬性並儲存在實體文檔。協議就像是一些規範,實踐協議的類必須遵守這些規範。建立協議 xcode-->File -->New --> New File --> Cocoa Touch --> Objective - C Protocol -->Next -->協議名稱(eg:PersonProtocol)-->Save實際聲明協議:#import<Foundation/
Time of Update: 2013-12-10
使用控制器和視圖Model 應用程式的核心 負責計算與建立一個虛擬世界,它不依靠View與Controller就能存在。(一個沒有外觀介面的應用程式)Controller在Xcode通常是指View
Time of Update: 2013-12-10
斌子剛剛接觸IOS今天做項目的時候,遇到一個問題,在跳頁時需要進行傳參數。上網找了許多方法,書上也沒有找到很好的方法。所有功能都得自己慢慢摸索。最後找到了一個網友的文章,現在用delegate的方式來實現,實際上delegate傳值的實質就是:比如右AB兩個頁面,A想要傳值給B ,就只要先在A中得到B的指標,然後將想要傳的值賦給B,之後跳轉,話不多說直接上代碼。首先我們需要建一個delegate:[plain] @protocol PassValueDelegate -
Time of Update: 2013-12-10
以下是Chris Hulbert文章的主要內容:作為一名 iOS 開發人員,我最近終止了和Google(Sydney)的合約,我的工作是開發Google Maps Coordinate應用。在忘記這段經曆之前,我想和大家分享一些體驗和經曆。不過,因為時間不長,所以不會有什麼大爆料。在Google工作的 iOS 開發人員我那些 iOS
Time of Update: 2013-12-10
在 ipone 4s 以前,我們好像沒有過多的考慮螢幕相容的問題,因為iphone 智能的幫我們解決了,比如說 iphone iphone 3g iphone 3gs 為 320 *480 iphone 4 iphone 4s 為 640 *960我們很多情況下就是提供一個
Time of Update: 2013-12-10
在自訂協議的標頭檔 .h中@protocol NSDelegate <NSObject>@optional //可選- (void)OnOption:(NSString *)pStr;@required //必須- (void)OnRequired:(NSString *)pStr;@end @interface NSClass :NSObjectid<BSDelegate> delegate;@end @property(assian)
Time of Update: 2013-12-10
UILabel * label = [[UILabel alloc] init]; NSString * text = @"hellohellohellohellohellohellohellohellohellohellohellohello "; label.text = text; [label
Time of Update: 2013-12-10
1 前言IOS開發遵循MVC模型,即模型-視圖-控制器。視圖是展現給使用者的東西;模型是App管理的資料,也是App引擎的另一種叫法;控制器則是串連模型和視圖的橋樑。今天主要介紹一下,在建立跟視圖的ViewController時候,帶nib檔案和不帶nib檔案的區別。2 UIViewController使用上delegate的代碼.h檔案[plain]#import <UIKit/UIKit.h> #import
Time of Update: 2013-12-10
1 前言UILabel可以給使用者顯示靜態文字,並且設定文字的樣式。2 代碼執行個體ZYViewController.h: [plain]#import <UIKit/UIKit.h> @interface ZYViewController : UIViewController @property(nonatomic,strong) UILabel *myLabel; @end #import
Time of Update: 2013-12-10
[cpp] view plaincopyprint?在.h檔案匯入庫檔案 在.h檔案匯入庫檔案[cpp]#import <MediaPlayer/MPMoviePlayerViewController.h> #import <MediaPlayer/MPMoviePlayerViewController.h>[cpp] view plaincopyprint?在.m實現檔案中 在.m實現檔案中[cpp]NSString
Time of Update: 2013-12-10
蘋果App Store 的應用總下載量近日剛突破 250 億,並繼續上升中。毫無疑問,iOS 開發一直是熱門話題,這是一個製造了數億美元的產業。一個成功的應用,需要良好的規劃。在理解應用開發流程中,繪製線框圖是規劃階段重要一環,也用於確定
Time of Update: 2013-12-10
這裡主要側重於集合類的深淺拷貝,主要事因為工作的時候遇到這個問題。有不足的地方歡迎指正 首先我們需要有這樣的一個前提:[array addObject:obj];這樣obj的引用計數會增加1,如果使用remove則obj的引用計數會減一。ios對集合的記憶體處理就是這樣的。 那麼,假設obj只被array擁有:id temp = [array objectAtIndex:0];[array
Time of Update: 2013-12-10
如果在一個類中想要執行另一個類中的方法可以使用通知1.建立一個通知對象:使用notificationWithName:object: 或者 notificationWithName:object:userInfo: NSNotification* notification = [NSNotification notificationWithName:kImageNotificationLoadFailed(connection.imageURL) &