近期刚入手MacBook pro 系统10.7
赶快安装XCODE来提验一把。没想到安装的都快哭了。实在是受不了啊。去官网上下载XCODE 4.2
APPSTORE慢的要吐血,用3.*系列又安装不成功。好不容易安装成功后就找不到应用程序。相信有很多的朋友也会遇到同样的问题,附上解决方案。
解决方案有二个:
1.去developer.apple.com/downloads/download.action?path=Developer_Tools/xcode_4.2.1_for_lion/xcode_4.2.1_for_lion.dmg下载。
2.不放弃的安装3.*
第一步:
准备好xcode_3.2.5.dmg的包,用实用工具-》磁盘工具-》转换成可读写-》在Finder里面右键Xcode包(Xcode
and iOS SDK),选择“Show
Packages”-》进入Contents文件夹,用TextEdit打iPhoneSDKSL.dist文件搜索“10.7“,并用”10.8“替换并保存。
第二步:
进入实用工具->运行活动监视器->KILL iTunesHelper.安装第一步准备好的包即可。
(2012-02-07 15:55)
看到一篇很好的文章,特转过来做一个备忘。
本文转至:http://www.cnblogs.com/Yinkaisheng/archive/2011/11/12/2246379.html
学习WindowsPhone开发已经有一段时间了,喜欢装各种软件并思考他们是如何实现的,最近用了一个软件
“吾得地图生活服务助手”,功能挺多的,它用到了一些Google和MapABC的API,我想看看它到底用到了哪些API,于是想到了下面这个方法。
首先电脑要有无线网卡,手机支持WiFi,然后用Windows 7
系统的netsh命令创建一个虚拟WiFi,手机连接这个WiFi上网,在电脑用WireShark抓取虚拟WiFi的数据包。
详细步骤:
在Windows
7系统下,到C:\Windows\System32目录下找到cmd.exe,在cmd.exe右击“以管理员身份运行”(直接运行没有管理员权限,命令执行会失败)。
输入 netsh wlan set hostednetwork
mode=allow ssid=cmd key=12345678
回车,创建一个虚拟WiFi,ssid为WiFi的名字,key为密码
继续输入 netsh wlan start
hostedn
本文转至:http://www.j2megame.org/index.php/content/view/2650/165.html
plist文件,Property List 文件,一般都是xml文件格式,用于描述应用软件
主要包括如下:
|
关键字
|
类型
|
是否必须
|
摘要
|
| CFBundleDevelopmentRegion |
String |
No |
该束的地区。通常对应于作者的母语。 |
| CFBundleDisplayName |
String |
No |
本地化的束名。 |
| CFBundleDocumentTypes |
Array |
No |
一组描述了该束所支持的文档类型的字典。 |
| CFBundleExecutable |
String |
Yes |
该束 |
在客户端开发过程中我们经常需要用到网络请求,用到网络请求时如何处理当前界面呢?
最常用的办法就是转菊花了,呵呵让我们看下如何实现这种转菊花的效果。
实现方法很多可以用一个定时器,不停的去刷新图片。模拟转菊花的效果。
在IOS上系统给我们提供了这种系统的API,这样就省事多了。
//初始化
spinner = [[UIActivityIndicatorView alloc]
initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
//设置区域大小
[spinner setCenter:CGPointMake(kScreenWidth/2.0,
kScreenHeight/2.0)]; // I do this because I'm in landscape
mode
// spinner is not visible until started
//添加到VIEW上
[self.view addSubview:spinner];
[spinner release];
//启动动画
[spinner startAnimating];
//停止动画
[spinner stopAnimating];
有些时候我们需要获得手机上的系统日历,时间,甚至毫秒。如何解决这些问题呢?
1.取日历时间
//取当前的日历
NSCalendar *calendar = [NSCalendar
currentCalendar];
//获取指定日期组件
NSDateComponents *components = [calendar
components:(NSMonthCalendarUnit | NSDayCalendarUnit |
NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit)
fromDate:[NSDate date]];
//分别取出时间值
NSInteger second = [components second];
NSInteger minute = [components minute];
NSInteger hour = [components hour];
NSInteger day = [components day];
NSInteger month = [components month];
2.按照指定的数据格式取年月日时分秒
//初始化时间按指定的格式输出
NSDateFormatter *dateFormatter = [[NSDateF
绘制UI时少不了用到UILabel,如何绘制一个透明的UILabel呢。呵呵做个备忘。
1.初始化字体
UIFont *font = [UIFont systemFontOfSize:22];
2.初始化UILabel
UILabel *successLabel = [[UILabel
alloc]initWithFrame:CGRectMake(fontStartx, fontStarty, iconWidth,
iconHeight)];
3.将背景设置为透明
[successLabel setBackgroundColor:[UIColor clearColor]];
4.设置字体色
[successLabel setTextColor:[UIColor whiteColor]];
5.设置文本
[successLabel setText:nameString];
6.设置字体
[successLabel setFont:font];
7.添加到VIEW上
[self addSubview:successLabel];
8.析构
[successLabel release];
(2011-10-24 22:14)
我们使用一种变通的方法来制作
iOS framework,废话不多说,上步骤:
1.打开Xcode创建一个“Cocoa
Touch Static Library”工程,并删除现有的target.
2.右键project选择添加New Target,在弹出的窗口中找到Cocoa ,在Cocoa右侧窗口中选择“Loadable
Bundle”。
注意:到这步的时候不要选择framework,应为framework是MAC OS上的,iOS是不支持的,但是iOS
支持“Loadable Bundle(cfbundle)”
3.target 上右键get Info 在Build Settings下面设置下面的5项内容:
a.搜索Wrapper Extension,把默认的bundle改成framework.
b.修改Mach-O Type 为Relocatable Object File.
c.关闭Dead Code
Stripping ,把勾去掉!
d.关闭Link With Standard Libraries.
e.移除所有关于“AppKit” 和 “Foundation”的参考,删除“Other
Linker Flags”的所有值
Iphone md5签名算法
添加头文件
#import <CommonCrypto/CommonDigest.h>
封装如下函数
+(NSString *)do_MD5_String:(NSString *)body{
const char *cStr = [body
UTF8String];
unsigned char
result[CC_MD5_DIGEST_LENGTH];
CC_MD5( cStr, strlen(cStr), result
);
NSMutableString *hash = [NSMutableString
string];
for(int i=0;i<CC_MD5_DIGEST_LENGTH;i++)
{
[hash
appendFormat:@'X',result[i]];
}
return [hash lowercaseString];
}
(2011-10-18 22:13)
曾经有人这么说过,在iphone里你看到的,摸到的,都是UIView,所以UIView在iphone开发里具有非常重要的作用。那么UIView我们到底知道多少呢。请看看下面的问题,
如果这些你都知道,那么本文章的内容就请绕道,如果你还不太清楚,我想看了下面的内容,你就明白了。
1。bounds和frame分别表示什么?
2。ContentMode里UIViewContentModeScaleToFill代表什么?
3。contentStretch
里的指定UIView里缩放区域是如何计算的?
4。UIVIew里的哪些属性变化可以用动画来呈现?
5。UIKit的坐标系和Core
Graphics的坐标系的差别是什么?
视图和窗口展示了应用的用户界面,同时负责界面的交互。UIKit和其他系统框架提供了很
呵呵,今天用到3Des加解密了,总结一下贴出来吼吼。
1.需要添加头文件#import <CommonCrypto/CommonCryptor.h>
2.还有准备Base64编码
//
// GTMBase64.h
//
// Copyright 2006-2008 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the
'License'); you may not
// use this file except in compliance with the License.
You may obtain a copy
// of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
software
// distributed under the License is distributed on an 'AS IS'
BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied. See the
// License for the specific language governing permissions
and limitations under
// the License.
//
// WARNING: This class provides a subset o