原创 Mac多線程編程之NSThread的使用 (一)

著作權聲明:本文由http://blog.csdn.net/totogo2010/原創, 1、簡介: 1.1 iOS有三種多線程編程的技術,分別是: 1.、NSThread  2、Cocoa NSOperation (iOS多線程編程之N

原创 【phonegap】使用的java與js互相調用的原理

http://blog.sina.com.cn/s/blog_6e4d9a9b0101ny26.html Phonegap使用的java與js互相調用的原理。phonegap實現的模型剛也說了,有同步和異步兩種。js實現的api,所

原创 Mac環境下Linux下SVN server搭建

近日由於項目需要在Linux server上搭建一個SVN的server環境,於是在網上尋找了一些資料,在參考各位網友文章的基礎上,成功搭建了svn服務器。期間也碰到一些問題,特在此記錄一下。 【1】SSH登錄到雲服務器 Mac下,SS

原创 【XMPP】gloox開源代碼分析

最近項目上需要用到gloox的開源代碼,結合項目的特性,對XMPP有了部分了解,期間碰到的問題大致如下: 1. Gloox工程的移植 網上有不少Gloox的測試代碼,找一份XCode平臺下能編譯通過的即可,筆者找的一份爲“glooxFor

原创 Implicit intents with startService are not safe錯誤的解決方式

原文鏈接:http://www.eoeandroid.com/thread-568853-1-1.html 有些時候我們使用Service的時需要採用隱私啓動的方式,但是Android 5.0一出來後,其中有個特性就是Service In

原创 【Cocoa】cocoa UI 常用算法

1. 計算字符串高度 - (void)resizeTextField:(NSTextField *)textField withAttributeString:(NSAttributedString *)attrStr andFixedW

原创 【XMPP】client 連接server的過程

參考:http://api.yandex.com/disk/doc/dg/concepts/xmpp_xmpp-connection.xml Establishing the server connection The appli

原创 【Mac】NSTextField And AutoLayout: Autogrow height -> Programmatically

【solution1】 Hence, a custom subclass of NSTextField can override this method to return a better value, such as the one

原创 【Mac】獲取app相關的信息

獲取文件相關信息,創建時間,修改時間等;   -(NSString*)bundleCreateDate { NSBundle* mainBundle = [NSBundle mainBundle]; NSString*

原创 【Mac】Mac OS 捕獲異常並打印

1. 添加庫文件 ExceptionHandling.framework 2. 在 applicationDidFinishLaunching 添加       //add the excepiton catch     [[NSExce

原创 【Mac】MacOS: shell script from application

啓動一個腳本   NSTask *task = [[NSTask alloc] init]; [task setLaunchPath:@"/path/to/script/sh"]; [task setArguments:[NSArray

原创 【Mac】Detecting File Dragging in Cocoa

// properties for preventing consistently calling var mouseDidDragged = false var shouldCallForMouseDrag = true // a s

原创 【Mac】Uninstall App

刪除app的緩存,同時把app移到trash   -(void)clearMemoryCache { NSString* rootPath = @""//Cache path; NSError* error = nil;

原创 【Mac】NSWindow 添加child window,如何居中

父窗口添加子窗口,常常會出現窗口不能居中顯示,即使調用接口: - (void)center; 仍然會存在垂直不居中的問題,那應該如何處理呢? 從文檔中看: The window is placed exactly in the cent

原创 【Mac】關於property的各個修飾符

引用:https://blog.csdn.net/shenzhonglaoxu/article/details/47807081   1、atomic 和 nonatomic atomic是默認的屬性,表示對對象的操作屬於原子操作,主要是