上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 21 下一页
摘要: NSInteger pageNumber; 和 NSInteger *pageNumber; xcode 都能识别,但是二者有什么区别? 阅读全文
posted @ 2013-05-26 04:57 ygm900 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 静听夜雨 阅读全文
posted @ 2013-05-26 03:33 ygm900 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 为了让用户能有良好的操作体验,一般地建议按如下方式设计人机交互操作。第一步:绘制基本界面第二步:向后台请求数据第三步:将数据加载到界面上 阅读全文
posted @ 2013-05-26 03:11 ygm900 阅读(101) 评论(0) 推荐(0) 编辑
摘要: 如下,当偏移量达到50%时,就翻页page = floor((scrollView0.contentOffset.x - pageWidth / 2) / pageWidth) + 1; 阅读全文
posted @ 2013-05-26 02:53 ygm900 阅读(251) 评论(0) 推荐(0) 编辑
摘要: 方法: 再百度地图的委托方法 - (void)mapView:(BMKMapView *)mapView didUpdateUserLocation:(BMKUserLocation *)userLocation 中设置:[mapView setShowsUserLocation:NO];例子代码:- (void)viewDidLoad{ [super viewDidLoad]; configData = [NSUserDefaults standardUserDefaults]; //初始化对象 //启动BMKMapManager (加载百度地图前,必须... 阅读全文
posted @ 2013-05-26 02:26 ygm900 阅读(515) 评论(0) 推荐(0) 编辑
摘要: 在开发过程中,数据的输入和输出全部用string类型进行交互,是否会更好一些?只有在使用数据的时候根据需要对数据进行转型。这样是否可以屏蔽多种数据类型的繁杂。 阅读全文
posted @ 2013-05-26 02:14 ygm900 阅读(119) 评论(0) 推荐(0) 编辑
摘要: pageControl0.currentPage = page;当scrollview load 某个page 时,就会将这个page传递给pagecontrol,让其作出相应的反应。 阅读全文
posted @ 2013-05-26 01:39 ygm900 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 将一个view 的背景设为透明 但view上的图标 不透明 代码:[view setBackgroundColor:[UIColorcolorWithWhite:0alpha:0]];实现类似iphone ipad 主页的滑动效果,思路:1、只要将scrollview 设置为上述的透明,然后将scrollview 添加为一个view的子页面,而这个view 有背景图片就可以了。这样,就实现了图标滑动而背景不会滑动的效果。即,不要为scrollview 设置背景图片就好了。 阅读全文
posted @ 2013-05-26 01:01 ygm900 阅读(978) 评论(0) 推荐(0) 编辑
摘要: 这是因为ios6中的xib有AutoLayout这个属性,默认为选中,然后运行在低于ios6.0的机器中,会崩溃,报*** Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named NSLayoutConstraint'*** First throw call stack:这个异常。只需将AutoLayout设为不选中即可参考:http://blog.sina.com.cn 阅读全文
posted @ 2013-05-26 00:17 ygm900 阅读(1047) 评论(0) 推荐(0) 编辑
摘要: 如下: if (nil == view.superview) { //判断一个view 是否被加载过 如果被加载过,它的superview就不会是nil CGRect frame = scrollView0.frame; frame.origin.x = frame.size.width * page; frame.origin.y = 0; view.frame = frame; [scrollView0 addSubview:view]; ... 阅读全文
posted @ 2013-05-26 00:14 ygm900 阅读(947) 评论(0) 推荐(0) 编辑
摘要: 在XCODE中无法使用TAB键对多行代码进行缩进。想多行缩进,选中需要缩进的代码使用快捷键command(花键)+] 即可右缩进,同理,左缩进只需要command(花键)+[ 即可,也可以通过editor->structure下的 Shift Right 和 Shift Lift 命令(4.3.2版本)来进行缩进。 阅读全文
posted @ 2013-05-26 00:06 ygm900 阅读(18911) 评论(0) 推荐(0) 编辑
摘要: 类中,方法封装的意义在于 代码的语义集中,便于为后期恢复整个逻辑思维链条提供方便。 阅读全文
posted @ 2013-05-25 23:50 ygm900 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 在调试程序时,遇到如下两条信息:Expected identifierExpected ';' after method prototype原因:A.h文件 在B.h文件#import 导致A.h文件报出如上错误提示,只要将声明文件写在B.m文件中即可解决上述问题。为什么?B.h 文件#import <UIKit/UIKit.h>@interface WelcomeViewController : UIViewController@endB.m文件#import "WelcomeViewController.h"#import <Quart 阅读全文
posted @ 2013-05-25 20:23 ygm900 阅读(3904) 评论(0) 推荐(0) 编辑
摘要: 证书管理苹果开源代码http://www.opensource.apple.com/source/iOS 开发者中心 https://developer.apple.com/devcenter/ios/index.action苹果申诉——Contact t... 阅读全文
posted @ 2013-05-25 02:16 ygm900 阅读(1629) 评论(0) 推荐(1) 编辑
摘要: mac 默认的iphone5模拟器尺寸太大,为了方便调试和查看,我们讲其调整为与真机相仿的尺寸。方法:打开模拟器->在上方的菜单中选择‘Window’->打开Window菜单,中的‘缩放比例’->选择50% 阅读全文
posted @ 2013-05-25 01:38 ygm900 阅读(1703) 评论(0) 推荐(0) 编辑
摘要: 用设置背景色的方法,设置一张背景图片: [self.viewsetBackgroundColor:[UIColorcolorWithPatternImage:[UIImageimageNamed:@"indexbg.jpg"]]]; 阅读全文
posted @ 2013-05-24 23:44 ygm900 阅读(166) 评论(0) 推荐(0) 编辑
摘要: iphone4/4s 应用程序升级适配 iphone5 的方法有很多,而且其中原理在网上也找的到。本次废话不多说,单简要叙述我的过程:综合权衡,我选择用 增加xib文件的方法。第一步:为需要适配找到工程中需要适配iphone5的xib文件,加入是AViewController。首先,到工程文件目录下,找到AViewController.xib文件,然后在同一文件夹下拷贝一份,重命名为AViewController_ip5.xib 文件。第二步:将AViewController_ip5.xib 添加到工程中;因为AViewController_ip5.xib文件是AViewController. 阅读全文
posted @ 2013-05-24 22:50 ygm900 阅读(4288) 评论(0) 推荐(1) 编辑
摘要: 参考: http://www.cnblogs.com/minglz/archive/2012/12/11/2809368.html一个view 用两个xib 文件的代码实例:if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) { YourViewController *vc = [[[YourViewController alloc] initWithNibName:@"YourViewController_iPhone" bundle:nil] autoreleas 阅读全文
posted @ 2013-05-24 18:27 ygm900 阅读(9572) 评论(0) 推荐(0) 编辑
摘要: 一、新建一个single view application类型的iOS application工程,名字取为CustomView,如下图,我们不往CustomViewViewController.xib中添加任何控件:二、新建一个CustomView.xib,过程如下:然后往界面上拖一个label和一个button:接下来得建立CustomViewViewController.xib中的view与CustomView.xib的关联了,即将Custom.xib动态加载,然后将该view做为CustomViewViewController的view的subview,放置于正中显示(设置Custom 阅读全文
posted @ 2013-05-24 18:04 ygm900 阅读(21634) 评论(0) 推荐(0) 编辑
摘要: 原帖:http://blog.csdn.net/startexcel/article/details/7211292xib 中, 没有对File's Owner 的Outlets view 进行绑定, 导致在父视图中插入子视图时出错, 在IB中拖拽Files' Owner到view, 添加绑定后, 运行成功!总结一下创建视图和绑定的步骤:1. 创建控制器. File->New File->Iphone OS->Cocoa Touch Class->UIViewController subclass;2. 创建xib. File->New File- 阅读全文
posted @ 2013-05-24 17:37 ygm900 阅读(2634) 评论(0) 推荐(0) 编辑
摘要: CGSize size; size.height = 7; //自定义圆点的大小 size.width = 7; //自定义圆点的大小 [myView setFrame:CGRectMake(dot.frame.origin.x, dot.frame.origin.y, size.width, size.width)]; 阅读全文
posted @ 2013-05-24 16:26 ygm900 阅读(186) 评论(0) 推荐(0) 编辑
摘要: 方法:参考:http://blog.csdn.net/gckjdev/article/details/8072484http://www.cnblogs.com/ygm900/archive/2013/05/24/3096885.htmlhttp://www.cnblogs.com/ygm900/archive/2013/05/23/3095088.html 阅读全文
posted @ 2013-05-24 15:26 ygm900 阅读(238) 评论(0) 推荐(0) 编辑
摘要: 1、使用宏定义方法判断#define iPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)2、在程序中涉及到全屏的宽高的时候,初始化的时候,代码中不要写320和480#define Screen_height [[UIScreen mainScreen] bounds].size.height#define Screen_wid. 阅读全文
posted @ 2013-05-24 14:47 ygm900 阅读(1161) 评论(0) 推荐(0) 编辑
摘要: 1、初始化+ (NSTimer *)timerWithTimeInterval:(NSTimeInterval)ti target:(id)aTarget selector:(SEL)aSelector userInfo:(id)userInfo repeats:(BOOL)yesOrNo;+ (NSTimer *)scheduledTimerWithTimeInterval:(NSTimeInterval)ti target:(id)aTarget selector:(SEL)aSelector userInfo:(id)userInfo repeats:(BOOL)yesOrNo;注:不用 阅读全文
posted @ 2013-05-24 11:20 ygm900 阅读(3247) 评论(0) 推荐(0) 编辑
摘要: 参考:http://blog.csdn.net/wbw1985/article/details/7874688 IOS开发之---static变量在静态方法中使用变量,需要将变量声明为static 类型。而且,声明的位置不是在.h文件中,而是.m文件中。例子:.m文件#import "InterfaceHelper.h"static UIAlertView *waitAlert; //在这个位置进行声明@implementation InterfaceHelper 阅读全文
posted @ 2013-05-24 11:10 ygm900 阅读(227) 评论(0) 推荐(0) 编辑
摘要: //大全//读取数据库数据-(void)movethesqlitefile{NSString*sourcepath=[[NSBundlemainBundle]pathForResource:@"database"ofType:@"sqlite"];NSLog(@"===================================%@",sourcepath);NSFileManager*filemanager=[NSFileManagerdefaultManager]; NSString*documentsDirectory= [ 阅读全文
posted @ 2013-05-24 10:41 ygm900 阅读(5130) 评论(0) 推荐(0) 编辑
摘要: iphone的UIPageControl控件可以显示用户huan'dong滑动到的页码。但是里面的小点的颜色时默认的白色。如果背景也是白色的hu话,你就悲剧了。于是乎上网找了一些资料,找到了改变UIPageControl空间xiao'da小点颜色的方法。解决fang'r方法如下:GrayPageControl.h:#import <Foundation/Foundation.h>@interface GrayPageControl : UIPageControl{ UIImage* activeImage; UIImage* inactiveImage;}@ 阅读全文
posted @ 2013-05-24 08:51 ygm900 阅读(17924) 评论(0) 推荐(0) 编辑
摘要: 代码的世界中,一个逻辑套着另外一个逻辑,如何让每一种逻辑在代码中都有迹可循?这正式框架的意义所在! 阅读全文
posted @ 2013-05-24 08:26 ygm900 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 对数据的验证要进行集中管理。编撰独立的方法,输出的数据保证是全部经过验证的。这样可以有效地避免各种验证散落在程序的各个角落。回头就忘记自己有没有对数据进行足够的验证。 阅读全文
posted @ 2013-05-23 17:53 ygm900 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 首先需要一个高级一点的Xcode版本,现在一般都要4.5以上了吧,然后将你的应用在模拟器中运行,选择 硬件-->设备--> iPhone (Retina 4- inch)这个就是iphone 5 的分辨率。没有做过适配的应用就会在上下两端出现黑边,那么如何做适配呢?1.首先需要添加一张启动图片,图片名字命名为Default-568h@2x.png,设置好以后,启动看,就会发现上下的两条黑边不见了。2. 3.5- inch 的屏幕的高度 480,而4.0 - inch 的高度为568, 所以对于以前一些 硬编码设置 CGRect,CGPoint,CGSize的地方要重新设置过,一般也 阅读全文
posted @ 2013-05-23 16:20 ygm900 阅读(1393) 评论(0) 推荐(0) 编辑
摘要: 数据排版理念:UITableView 中显示的数据可以先通过特定的方法进行排版,再加载到数据立标中等分法确定空间在屏幕中的位置:将一个view 进行8等分或者10等分。这样可以轻易计算出控件元素在view中的坐标。 阅读全文
posted @ 2013-05-23 16:17 ygm900 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 苹果开发者证书 管理入口 https://developer.apple.com/ios/manage/overview/index.action最好直接通过以上路警登陆,而不要跳转。在跳转过程中,有过无法加载页面的经历。只用用safari 浏览器进行登陆。别的浏览器不支持。苹果的这个网站服务器经常链接不上。在mac 上的safari 试试如果步行,可以尝试换window 下的safari试试。2013年后,苹果的开发者网站做了改版,同时也有一些特性的变化。比如如下:新版的开发者网站局部控件(也可能是全部)不支持中文,如在添加device时,只能输入英文。不支持中文了。下面四个中文名字时去年. 阅读全文
posted @ 2013-05-23 14:11 ygm900 阅读(854) 评论(0) 推荐(0) 编辑
摘要: 在例子中,每个代码区域,每个参数做什么,都写清楚。届时,将直接将例子拖入到工程中然后根据例子改改即可使用。 阅读全文
posted @ 2013-05-23 01:47 ygm900 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 1、用[_searchdrivingSearch:nilstartNode:start endCity:nilendNode:end]; 方法查询公交路线 返回错误码 1002013-05-22 23:46:47.264 Travel[938:907] 公交查询的城市是====济南2013-05-22 23:46:47.267 Travel[938:907] 公交路线起点坐标====36.708721,117.1251142013-05-22 23:46:47.269 Travel[938:907] 公交路线终点坐标====36.849457,117.3918612013-05-22 23:. 阅读全文
posted @ 2013-05-22 23:50 ygm900 阅读(5107) 评论(0) 推荐(0) 编辑
摘要: 参考:http://www.2cto.com/kf/201207/138950.html 写的比较实在,可以看看初始化方法1: CLLocationCoordinate2D startPt = (CLLocationCoordinate2D){0, 0}; //纬度,经度 CLLocationCoordinate2D endPt = (CLLocationCoordinate2D){0, 0};初始化方法2:CLLocationCoordinate2D coords = CLLocationCoordinate2DMake(39.915352,116.397105);//纬度,经度... 阅读全文
posted @ 2013-05-22 23:13 ygm900 阅读(23828) 评论(0) 推荐(0) 编辑
摘要: //百度地图删除地图上所有的标注和所有的覆盖物NSArray* array = [NSArrayarrayWithArray:_mapView.annotations];[_mapViewremoveAnnotations:array];array = [NSArrayarrayWithArray:_mapView.overlays];[_mapViewremoveOverlays:array]; 阅读全文
posted @ 2013-05-22 22:54 ygm900 阅读(2013) 评论(0) 推荐(0) 编辑
摘要: 再A类中存储数据configData = [NSUserDefaultsstandardUserDefaults];[configData setObject:@"1" forKey:@"11"];[configData setObject:@"2" forKey:@"12"];[configData synchronize]; //强制存储数据再B类中读取数据 configData = [NSUserDefaults standardUserDefaults]; NSString *strLat = [confi 阅读全文
posted @ 2013-05-22 14:39 ygm900 阅读(211) 评论(0) 推荐(0) 编辑
摘要: - (void)viewDidLoad { NSLog(@"进入GRailwayController.m的viewDidLoad方法"); [super viewDidLoad]; zoomLevel = 3.0f;//启动BMKMapManager bmkMapManager = [[BMKMapManager alloc]init]; BOOL ret = [bmkMapManager start:@"2772BD5CAFF652491F65707D6D5E9ABEBF3639CC" generalDelegate:self]; if (!ret) 阅读全文
posted @ 2013-05-22 13:37 ygm900 阅读(20685) 评论(0) 推荐(0) 编辑
摘要: /** 用户位置更新后,会调用此函数 @param mapView 地图View @param userLocation 新的用户位置 在实际使用中,只需要 [mapView setShowsUserLocation:YES]; mapView.delegate = self; 两句代码就可以启动下面的方法。疑问,为什么我的位置没有移动的情况下,这个方法循环被调用呢? */- (void)mapView:(BMKMapView *)mapView didUpdateUserLocation:(BMKUserLocation *)userLocation{ if (... 阅读全文
posted @ 2013-05-22 13:30 ygm900 阅读(287) 评论(0) 推荐(0) 编辑
摘要: 除了高内聚,松耦合之外,我们还应该追求:思路的快速回馈。开发人员能够快速地找回他以前的思路。 阅读全文
posted @ 2013-05-22 11:41 ygm900 阅读(117) 评论(0) 推荐(0) 编辑
上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 21 下一页