七月 27th, 2011
Cocoa, how to
本文采用的方式是使用Mac OS X 10.5.6自带的Apache和PHP,安装MySQL的dmg版本,以下操作非特殊说明均以root用户在命令行下进行。
启用root用户
1.打开“目录实用工具”,它位于“应用程序”文件夹的“实用工具”文件夹中。
2.点按锁图标以进行更改。您将需要输入管理员名称和密码。
3.选取“编辑”>“启用 Root 用户”。
4.为 root 用户输入安全密码,然后在“验证”栏再次输入它,最后点按“好”。
启用Apache
Mac OS X 10.5.6自带了Apache 2.2.9,直接在命令行运行apachectl start,Apache就搞定了。
现在Apache的主目录就是/Libary/WebServer/Documents/,你可以在这目录里放置文件测试了。
启用PHP
Mac OS X 10.5.6自带了PHP 5.2.6,我们需要做的就是将PHP加入Apache中。
修改/etc/apache2/httpd.conf中的
#loadModule php5_module libexec/apache2/libphp5.so
为
loadModule php5_module libexec/apache2/libphp5.so然后将/etc/php.ini.default复制为/etc/php.ini。
cp /etc/php.ini.default /etc/php.ini之后就可以按照自己的习惯修改php.ini的配置
比如将error_reporting = E_ALL & ~E_NOTICE
修改为
error_reporting = E_ALL最后,重启Apache,可以在/Libary/WebServer/Documents/目录中建立个phpinfo.php来测试了。
apachectl restart
安装Mysql
七月 26th, 2011
Cocoa, how to
Download CURL source from:http://curl.haxx.se/download.html
1 2 3 4 5 6 7
| tar -xvzf curl-7.21.2.tar.gz
cd curl-7.21.2
export CC=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-gcc-4.0.1
export CFLAGS="-isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk"
export LDFLAGS="-isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk -Wl,-syslibroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk"
export CPP=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/cpp
./configure --disable-shared --without-ssl --without-libssh2 --without-ca-bundle --without-ldap --disable-ldap --host=arm-apple-darwin10 |
By configuring with isysroot and syslibroot set the correct SDK, the CURL_SIZEOF_LONG and SIZEOF_LONG will get set to the correct value (4).
In Xcode, choose File->New Project->iOS->Library->Cocoa Touch Static Library.
Add->Existing Files (select curl’s “src” folder)
Add->Existing Files (select curl’s “lib” folder)
Remove “src/macos” folder from project. (Delete->Delete references)
Unselect Makefile and Makefile.inc checkboxes for target.
In “Build” tab search for OTHER_CFLAGS and add the following options:
-DHAVE_CONFIG_H -I/ca/dev/code/lib/curl/curl-latest/include -I/ca/dev/code/lib/curl/curl-latest/lib
Replace /ca/dev/code/lib/curl/curl-latest with the path at which you untarred the CURL source.
Build both Simulator/Release and Device/Release.
To make a universal library for both the simulator and the device, execute lipo from the command line of the Xcode project folder:
lipo -create build/Release-iphonesimulator/libcurl.a build/Release-iphoneos/libcurl.a -output libcurl.a
The last step is to add libCURL to your app by right-clicking (or option-clicking) Frameworks->Add->Add Existing Frameworks…->Other and choosing the libCURL.a file created by lipo.
In attachment You can find project and compiled lib.
the original resource – http://www.creativealgorithms.com/blog/content/building-libcurl-ios-42
Source code: Download
注意替换相应的路径
编译后的文件在
~/Library/Developer/Xcode/DerivedData/curl-aaqusppogmokgpgnggbgmkotqydh/Build/Products
(假设你的target名字是curl)
另外这里没写的
1.在search path里把curl/include加进去
2.修改build scheme,将build类型改成release
原文:http://blog.ideas-world.com/2011/03/14/building-libcurl-for-ios-4-2/(须翻墙)
还有一篇:http://blog.boreal-kiss.net/2011/03/15/how-to-create-universal-static-libraries-on-xcode-4/
七月 24th, 2011
resources, websites&blogs
https://github.com/pokeb/asi-http-request/tree
七月 24th, 2011
websites&blogs
http://developers.enormego.com/
七月 24th, 2011
resources
https://github.com/enormego/cocoa-helpers
七月 24th, 2011
resources, 全部
https://github.com/samvermette/SVSegmentedControl
七月 24th, 2011
Cocoa, resources
这是一个IOS UI库,有一些UI界面的解决方案
https://github.com/devinross/tapkulibrary#readme
在Project中使用
Clone the TapkuLibrary git repository: `git clone git://github.com/devinross/tapkulibrary.git`. Make sure you store the repository in a permanent place because Xcode will need to reference the files every time you compile your project.
Locate the src/TapkuLibrary.xcodeproj and src/TapkuLibrary.bundle and add these to your XCode project (Figure 1). (use ‘Add files to project’ from ‘File’ menu instead of dragging and dropping, to prevent crash when adding target dependency in next step. c.f. Xcode 4 bug)
Figure 1
Select your main Xcode project from the sidebar in Xcode and then select the project target. Select the Build Phases tab.
Under the Target Dependencies group, click the plus button, select TapkuLibrary from the menu, and choose Add. (Figure 2)
Under the Link Binary With Libraries group, click the plus button, select libTapkuLibrary.a from the menu, and choose Add. Also add MapKit and QuartzCore. (Figure 2)
Figure 2
Choose the Build Settings tab. Make sure All in the top left of the bar under the tabs. Add the path to the src folder to Header Search Path (do not click the Recursive checkbox). Add -all_load -ObjC to Other Linker Flags.