2013年8月27日
摘要: 对于Scroll views一个最基础的问题就是content size。Scroll view将严格按照这个size来展示其内容。展示一个size大于screen的图片:头文件:#import @interface ViewController : UIViewController@property (strong,nonatomic) UIImageView *imageView;@property (nonatomic,strong) UIScrollView *myScrollView;@end实现#import "ViewController.h"@interfa 阅读全文
posted @ 2013-08-27 12:45 (@_@)~ 阅读(285) 评论(0) 推荐(0) 编辑
  2013年8月25日
摘要: 头文件#import @interface ViewController : UIViewController@property (nonatomic,strong) UIButton *myButton;@end实现#import "ViewController.h"@interfaceViewController ()@end@implementation ViewController- (void) buttonIsPressed: (UIButton *) paramSender { NSLog(@"Button is pressed.");}- 阅读全文
posted @ 2013-08-25 19:24 (@_@)~ 阅读(223) 评论(0) 推荐(0) 编辑
摘要: textField在Interfa Builder中不能改变高度,但是在代码中可以,无论怎么改变其高度,行数始终是1头文件#import @interface ViewController : UIViewController //为了监听用户触发的事件,例如开始输入,完成输入等,text Field要有自己的代理,这个代理遵守协议@property (nonatomic,strong) UITextField *textField;@property (nonatomic,strong) UILabel *labelCounter;@end实现#import "ViewContr. 阅读全文
posted @ 2013-08-25 17:04 (@_@)~ 阅读(318) 评论(0) 推荐(0) 编辑
  2013年8月23日
摘要: 头文件:#import @interface ViewController : UIViewController@property (nonatomic,strong) UILabel *myLabel;@end实现:#import "ViewController.h"@interfaceViewController ()@end@implementation ViewController- (void)viewDidLoad{ [superviewDidLoad]; CGRect lableFrame = CGRectMake(0.0f,0.0f,100.0f,500.0 阅读全文
posted @ 2013-08-23 19:34 (@_@)~ 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 1.简单的data:string、numbers/boobleans,dates,arrays.可以保存在合适的lists(.plist)中。2. 储存应用程序的设置或者一些偏好:最好不要存储,如果一定要,苹果有setting rules叫setting bundle3.SQLite 数据库,可以在里面储存一些表格。4 Core Data5 iCloud Storage6.储存在哪:ios有一个文件系统(不是经常用),应用程序有一个文件夹:tmp and library folder(路径不明显而且不是自己决定的); 阅读全文
posted @ 2013-08-23 15:44 (@_@)~ 阅读(513) 评论(0) 推荐(0) 编辑
摘要: seguescene------->scene1.push: 转换在nav controller下才有作用(选中第一个view--Editor--Embed in(把……嵌入)--Nav Controller)2. 需要为每一个scene创建一个类,我们向这个scene中拖拽的是哪种controller那么这个对应的类就继承哪种controller。将这些类加入到对应的controller中(修改Custom Class 下的Class,使其是这个scene对应的那个类名。)3. 在每一个.h文件中引入本身要转向的那个.h文件4.新方法:-(void)prepareForSegue,用来 阅读全文
posted @ 2013-08-23 15:38 (@_@)~ 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 1. 工程项目模板类型的更改 Xcode4时代 Xcode4+新模板Navigation-based Application ------->Master-Detail Application=> iphoneSplite View-based Application ------->Master-Detail Application => ipadOpenGL ES Application --------------->OpenGL GameTab Bar Application --------------->Tabbed ApplicationUti 阅读全文
posted @ 2013-08-23 15:37 (@_@)~ 阅读(344) 评论(0) 推荐(0) 编辑
摘要: main--UIApplicationmain--UIApplication--app delegate--监听启动应用程序等动作自动调用一些方法如加载UIWindow(透明的)--view controller(.h .m and .xib)等,再AppDelegate中有详细描述。相应的ViewController也会调用一些方法如viewDidLoad. 阅读全文
posted @ 2013-08-23 15:33 (@_@)~ 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 1. [myTextField resignFirstResponder];2. 按空白处消失:拖入一个Butto,使其布满整个view,设置起为Send to Back (editor--Arrange--Send to Back),改变Type为custom使其颜色为原来view的背景颜色。最后将其与code链接IBAction{[myTextField resignFirstResponder];}3.使用KeyBoard上的Return键使其消失:设置textField的Outlets中delegate链接到File's owner.(因为textfield object可以使 阅读全文
posted @ 2013-08-23 15:30 (@_@)~ 阅读(280) 评论(0) 推荐(0) 编辑
摘要: 崩溃:有两种最基本的crash类型常发生:SIGABRT(也叫EXC_CRASH)和EXC_BAD_ACCESS(也可能会是SIGBUS或者SIGSEGV)。就crash而言,SIGABRT是一个比较好解决的,因为他是一个可掌控的crash。App会在一个目的地终止,因为系统意识到app做了一些他不能支持的事情。EXC_BAD_ACCESS是一个比较难处理的crash了,当一个app进入一种毁坏的状态,通常是由于内存管理问题而引起的时,就会出现出现这样的crash。[UINavigationController setList:]: unrecognized selector sent to 阅读全文
posted @ 2013-08-23 15:28 (@_@)~ 阅读(308) 评论(0) 推荐(0) 编辑