摘要:1. 首先确保在Device,release版本下成功编译了App。2. 在Targets下面添加一个新的Shell Script Target。3. 将以下代码复制进去即可:# shell script goes here# compress application./bin/mkdir $CONFIGURATION_BUILD_DIR/Payload/bin/cp -R $CONFIGURATION_BUILD_DIR/iBI.app $CONFIGURATION_BUILD_DIR/Payload/bin/cp images/logo.png $CONFIGURATION_BUILD_D
阅读全文
随笔分类 - 5. IOS技术
IOS技术
摘要:Been updated the XCode and iPhone SDK into 3.2, now I am ready to debug my apps directly on my jailbroken iPhone 3G. This hacks will save you $99 from paying Apple just to code for fun or perhaps profit.Needed steps are:1. Jailbreak your iPhone.2. Install AppSync or Installd Patch, mine is using App
阅读全文
摘要:走马灯效果实现原理,就是利用iPhone自带的动画来控制UILable的y轴位置: 代码如下:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->//LampText.h@interfaceLampText:UILabel{floatmotionWidth;}@property(nonatomic)floatmotionWidth;@end//LampText.m#import"LampText.h"@implementa
阅读全文
摘要:protocol应用两个controller之间或者controller与自定义UIView之间的相互调用。 它的应用类似java或者C#里的interface。假设A调用B,B回调A,那么就可以如此设计: 首先:定义一个protocal:@protocolPtlChart@optional-(void)callBack:(id)arg;@required-(void)loadData;@end 第二步:在B里定义protocal的delegate:代码Code highlighting produced by Actipro CodeHighlighter (freeware)ht...
阅读全文
摘要:1. 首先定义define代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->/*sqlitepath*/#defineDBPATH@"kilonet.sqlite"/*Createsqlitetable*/#defineTBAccount"CREATETABLEIFNOTEXISTSAccount(IDINTEGERPRIMARYKEY,\usernameTEXT,\passwordTEXT,\isSavePW
阅读全文
摘要:In a view controller you have a UITextField and a UITableView. Assign the view controller to be the delegate of the both controls, plus the data source of the table.Implement the UITextField delegate methodtextField:shouldChangeCharactersInRange:replacementString:in your controller. This intercepts
阅读全文
摘要:As promised, here is a little How-I-did-it / How-To.First off: I am not an experienced SAX-User.. So this approach might be packing the problem at it’s tail, but this is how DOM-Users feel comfortable with ;)Let’s assume we want to parse the following XML:tranist.xmlview plaincopy to clipboardprint?
阅读全文
摘要:use theUIKit and Quartzto draw vector graphics.n example of the pie charts the code base generates is below (a screenshot):And now, for the code:GraphView.h123456789101112##(nothing to see here)##import <UIKit/UIKit.h>#import <Foundation/Foundation.h>@interface GraphView : UIView {}@endG
阅读全文
摘要:Java代码@implementationBrightnessController//MyCreateBitmapContext:SourcebasedonAppleSampleCodeCGContextRefMyCreateBitmapContext(intpixelsWide,intpixelsHigh){CGContextRefcontext=NULL;CGColorSpaceRefcolorSpace;void*bitmapData;intbitmapByteCount;intbitmapBytesPerRow;bitmapBytesPerRow=(pixelsWide*4);bitm
阅读全文
摘要:iPhone中的剪切技巧:1.获取图形上下文2.构造剪切的路径(形状)3.构建剪切区域4.贴上你的画Java代码//1CGContextRefcontext=UIGraphicsGetCurrentContext();//2CGRectbounds=CGRectMake(0.0f,0.0f,SIDELENGTH,SIDELENGTH);CGMutablePathRefpath=CGPathCreateMutable();CGPathAddEllipseInRect(path,NULL,bounds);//3CGContextAddPath(context,path);CGContextClip
阅读全文
摘要:Java代码//CourtesyofApple,CreateBitmapwithAlpha/RGBvaluesCGContextRefCreateARGBBitmapContext(CGImageRefinImage,CGSizesize){CGContextRefcontext=NULL;CGColorSpaceRefcolorSpace;void*bitmapData;intbitmapByteCount;intbitmapBytesPerRow;size_tpixelsWide=size.width;size_tpixelsHigh=size.height;bitmapBytesPerR
阅读全文
摘要:在iPhone中动画过度非常简单.首先获取当前的图形上下文:Java代码CGContextRefcontext=UIGraphicsGetCurrentContext();接着设置一些动画属性用于开始动画:Java代码[UIViewbeginAnimations:nilcontext:context];[UIViewsetAnimationCurve:UIViewAnimationCurveEaseInOut];[UIViewsetAnimationDuration:1.0];然后设置想要过度的对象的最终状态.Java代码[bigsetFrame:SMALLRECT];[bigsetAlpha
阅读全文
摘要:不知道4.0SDK带有手势的直接支持没有,至少3.2已经可以用了.但是如果想支持早期的版本,那么手势的识别无疑是一种痛苦,因为需要自己写代码来判定手势...下面代码是判断一个滑动的手势(swipe),虽然很简单但是总体思想就是这样了.当在一个水平,或者纵向滑动时给出一个滑动距离以及偏移量.当实际滑动距离超过指定的距离,且水平或者纵向的偏移量小于指定的偏移量则视为这个滑动手势判定成功!Java代码-(void)touchesMoved:(NSSet*)toucheswithEvent:(UIEvent*)event{UITouch*touch=touches.anyObject;CGPointc
阅读全文
摘要:navigation bar 分为三个部分,左按钮,右按钮和中间的View.在Controller中可以通过以三个方式来引用:self.navigationItem.titleViewself.navigationItem.leftBarButtonItemself.navigationItem.rightBarButtonItem左右按钮可以使用UIBarButtonItem来构造. 他默认有很多种按钮可攻选择:Java代码typedefenum{UIBarButtonSystemItemDone,UIBarButtonSystemItemCancel,UIBarButtonSystemIt
阅读全文
摘要:当文本输入时, 文本框有几中选择用于辅助输入:textField.clearButtonMode=UITextFieldViewModeWhileEditing;Java代码typedefenum{UITextFieldViewModeNever,//clearbutton永远不出现UITextFieldViewModeWhileEditing,//编辑的时候出现UITextFieldViewModeUnlessEditing,//未编辑的时候出现UITextFieldViewModeAlways//永远都出现}UITextFieldViewMode;弹出的键盘类型也可以辅助快速输入:text
阅读全文
摘要:-(BOOL)pointInside:(CGPoint)pointwithEvent:(UIEvent*)event{CGPointpt;floatHALFSIDE=SIDELENGTH/2.0f;//normalizewithcenteredoriginpt.x=(point.x-HALFSIDE)/HALFSIDE;pt.y=(point.y-HALFSIDE)/HALFSIDE;//x^2+y^2=radiusfloatxsquared=pt.x*pt.x;floatysquared=pt.y*pt.y;//Iftheradius<1,thepointiswithintheclip
阅读全文
摘要:核心函数是:CGContextAddArc(CGContextRefc,CGFloatx,CGFloaty,CGFloatradius,CGFloatstartAngle,CGFloatendAngle,intclockwise)CGContextRef: 图形上下文x,y: 开始画的坐标radius: 半径startAngle, endAngle: 开始的弧度,结束的弧度clockwise: 画的方向(顺时针,逆时针)有了这个函数可以画出任意扇形,所以饼图也不再话下.Java代码#definePI3.14159265358979323846#defineradius100staticinli
阅读全文
摘要:Texture2D :用图象或文字创建OpenGL 2D 的TextureLabel的定义:Label *left = [Label labelWithString:@"alignment left" dimensions:CGSizeMake(480,50) alignment:UITextAlignmentLeft fontName:@"Marker Felt" fontSize:32];Label labelWithString:label显示的文字即title部分dimensions:CGSizeMake:定义label在的尺寸即宽和高align
阅读全文
摘要:作者:virushuo发表于 2009-07-01 10:07 最后更新于 2009-07-01 23:07版权声明:可以任意转载,转载时请务必以超链接形式标明文章原始出处和作者信息及本声明。http://blog.devep.net/virushuo/2009/07/01/xcodecocoadylib.htmlupdate:留言中jjgod的方法更为正宗和简单。请参考。不过如果dylib之间有依赖关系,你又不想重新编译。那大概还是要用我这个办法的。所谓dylib,就是bsd风格的动态库。基本可以认为等价于windows的dll和linux的so。mac基于bsd,所以也使用的是dylib。
阅读全文
摘要:1. In the "info.plist" file, setting the following property:Code:<key>UIInterfaceOrientation</key> <string>UIInterfaceOrientationLandscapeRight</string>2. In the "applicationDidFinishLaunching" of the app delegate, calling the following code:Code:// Make t
阅读全文