Time of Update: 2015-07-22
標籤:儲存圖片到相簿最近在深入的學習關於swift相關技術,雖然海做不出什麼好的東西,但是感覺收穫不少,相信總有一樣能用到,所以就總結了一下,希望大家喜歡!1.OC中的寫法在OC中,我們需要儲存圖片到相簿需要調用這個方法: 1 void UIImageWriteToSavedPhotosAlbum(UIImage *image, id completionTarget, SEL completionSelector, void
Time of Update: 2015-07-22
標籤:UIWebView *webView = [[UIWebView alloc]initWithFrame:CGRectZero];NSString *myUserAgent = [webView stringByEvaluatingJavaScriptFromString:@"navigator.userAgent"];ios 獲得webview user-agent
Time of Update: 2015-07-22
標籤:ios xib strong weak iboutlet 有人問,在ARC下,IBOutlets到底應該定義成strong 還是 weak ?支援這個答案的人最多,答案僅是摘自官方文檔的一個片段: From a practical perspective, in iOS and OS X outlets
Time of Update: 2015-07-22
標籤:android 手機通訊錄 通訊錄搜尋 package contacters;import java.util.ArrayList;import java.util.HashMap;import java.util.List;import java.util.Map;import java.util.Map.Entry;import java.util.Random;public
Time of Update: 2015-07-22
標籤:mac eclipse sdk 翻牆 1.翻牆下載1.1.下載google的sdk,可以用紅杏翻牆。1.2.通過sdk manager更新下載sdk開發包,以前修改hosts檔案下載,現在沒有效果了,這次通過國內的鏡像進行下載。啟動 Android SDK Manager
Time of Update: 2015-07-22
標籤:相容手機 與PC 的一個外掛程式, 只是簡單的 向上,向下,向左,向右 的 。已經上傳我的檔案裡面。http://files.cnblogs.com/files/yjhua/touchwipe.js源碼如下:/* * ---------------------- * TouchWipe * ---------------------- * http://www.uedcool.com * by EddyZhang (張勇輝) * version 2.0
Time of Update: 2015-07-23
標籤:app 開發 網路 分布式系統 模式 作為移動端和網站開發人員,有大量現成的網路開發代碼可以使用在開發中直接使用。可惜的是沒有一套代碼可以代替我們全面考慮到網路的不可靠性,尤其是在移動端裝置上。同時,幸運的是有些著名的結論以及一些著名的模式可以協助我們思考如何優雅的處理現實世界中的現實問題。接下來讓我們一起思考著名的“分布
Time of Update: 2015-07-22
標籤: 1 int main(int argc, const char * argv[]) { 2 @autoreleasepool { 3 //OC數組 可以儲存不同類型的對象 只能儲存物件,基礎資料型別 (Elementary Data Type)是不能儲存的 4 //OC數組 儲存的是對象的指標 5 NSArray *array = [[NSArray alloc] initWithObjects:@"1",@"2",@"3",@"4
Time of Update: 2015-07-22
標籤:ios不能指定採用哪種定位方式,會根據裝置的情況和周圍的環境採用一套最佳的解決方案。再定位服務的應用中,第一次請求位置資訊時,系統會提示使用者是否允許開啟定位服務。Ios主要通過三個類來實現定位:1) CLLocationManager,用於定位服務管理類,它能夠給我們提供位置資訊和高度資訊。2) CLL
Time of Update: 2015-07-23
標籤: 一:開源網址 https://github.com/excilys/androidannotations/wiki 二:AndroidAnnotation特點 (1)依賴注入 可以注入 views, extras, system services, resources (2) 簡化執行緒模式 通過注釋你的方法,讓你的方法在ui線程執行,或者在a background thread執行 (3)
Time of Update: 2015-07-23
標籤:UIViewController的生命週期及iOS程式執行順序當一個視圖控制器被建立,並在螢幕上顯示的時候。 代碼的執行順序1、alloc 建立對象,分配空間2、init
Time of Update: 2015-07-22
標籤:#import <UIKit/UIKit.h>@interface UIColor (RandomColor)+(UIColor *) randomColor;@end#import "UIColor+RandomColor.h"@implementation UIColor (RandomColor)+(UIColor *) randomColor{ <pre name="code"
Time of Update: 2015-07-22
標籤:需求; 1.實現時間軸效果 2.資料顯示頂部為舊資料,底部為最新資料(說起來有點反正常iOS邏輯,但是這就是需求,認命吧~) 3.進入頁面時,直接滾動到最低部 4.部分Cell需要自適應 5.重新整理機制:底部為最新資料,向上滑到最底部時載入新的資料。向下滑動,動態載入舊資料。issus: 網路請求資料後,reloadData後。滾動到底部嘗試的解決辦法:1.滾動到底部: 解決辦法:
Time of Update: 2015-07-22
標籤:oc ios lbs 導航 利用系統的地圖App進行導航,只需要傳入起點和終點、啟動參數,調用MKMapItem的類方法openMapWithItems:launchOptions:來實現定位,調用此方法後會開啟系統的地圖App。下面我們來看看這個方法:+ (BOOL)openMapsWithItems:(NSArray *)mapItems
Time of Update: 2015-07-22
標籤:這道題以前寫過,bfs,用隊列,不多說了,上代碼:#include<stdio.h>#include<stdlib.h>#include<string.h>#include<queue>using namespace std;int map[10][10];int visit[10][10];int dist[10][10];int dx[8]={-2,-2,-1,-1,1,1,2,2};int dy[8]={-1,1,-2,2,-2,2,-
Time of Update: 2015-07-22
標籤:design-patternThe template method allow separate the generic method from a detail context(class) via inheritance Another advantage: 1.Inheritance implementation means that you will know the actual method implementation class before compilation,it
Time of Update: 2015-07-22
標籤:android 許可權 轉載請註明出處:http://blog.csdn.net/l1028386804/article/details/47010177
Time of Update: 2015-07-22
標籤:bindservice啟動服務上節我們學習了,如何用StartService啟動服務,這節學習如何用BindService啟動一個服務首先看MyActivity的代碼部分:public class MyActivity extends Activity {private Button btn_start;private Button btn_end;private MyServiceConnection sConnection;@Overrideprotected void
Time of Update: 2015-07-22
標籤: 1 int main(int argc, const char * argv[]) { 2 @autoreleasepool { 3 Person *p1 = [[Person alloc] initWithName:@"張三"]; 4 Person *p2 = [[Person alloc] initWithName:@"李四"]; 5 Person *p3 = [[Person alloc]
Time of Update: 2015-07-22
標籤:android 焦點 需求:點擊一個Button,,讓EditText獲得焦點;很簡單,1.在EditText的xml屬性中添加android:focusable="true"2.在Button的點擊事件中添加EditText的焦點判斷和焦點的獲得。 btn.setOnClickListener(new View.OnClickListener() { @Override