codecut iphone开发速查
来源:互联网 发布:it软件解决方案 编辑:程序博客网 时间:2024/04/30 01:37
使用tableview,textfield的内置方法一定要声明delegate。
为button设置字体颜色。
[cancelButtonsetTitleColor:[UIColorcolorWithRed:0.196green:0.310blue:0.522alpha:1.000]forState:UIControlStateNormal];
为button添加方法
[cancelButtonaddTarget:selfaction:@selector(clickCancel:)forControlEvents:UIControlEventTouchUpInside];
添加视图到后面and others.
[self.viewsendSubviewToBack:bgView]
addSubview,bringSubviewToFront, exchangeSubViewAtIndex:withSubviewAtIndex:,removeFromSuperview, subviews, superview, window.
actionsheet的使用 做交互的时候很有用
UIActionSheet*actions = [[UIActionSheetalloc]initWithTitle:nil delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:nil];
- (void)willPresentActionSheet:(UIActionSheet*)actionSheet
- (void)actionSheet:(UIActionSheet*)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
NSString 使用
NSString*myString =@"A String contant.";
[myString stringByAppendingString:@"22"];
[myString characterAtIndex:2];
[myString cStringUsingEncoding:NSUTF8StringEncoding];
[NSStringstringWithCString:[myStringcStringUsingEncoding:NSUTF8StringEncoding]encoding:NSUTF8StringEncoding];
NSString*path = [NSHomeDirectory() stringByAppendingPathComponent:@"Document/file.txt"];
NSError*error;
if(![myString writeToFile:path atomically:YES encoding:NSUTF8StringEncodingerror: &error]) {
NSString*inString = [NSString stringWithContentsOfFile:path usedEncoding:NSUTF8StringEncodingerror:error];
if(!inString) {
NSLog(@"error");
}
}
}
检测设备 用作判断
[[UIDevicecurrentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad
获得文件路径 读文件和取文件
AMBUNDLE(bundlePath)[[[NSBundle mainBundle] resourcePath]stringByAppendingPathComponent:bundlePath]
uitableview定义
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
- (NSInteger)tableView:(UITableView*)tableView numberOfRowsInSection:(NSInteger)section
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell*cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell ==nil) {
cell = [[[UITableViewCellalloc]initWithStyle:UITableViewCellStyleDefaultreuseIdentifier:CellIdentifier]autorelease];
}
// Configure thecell...
returncell;}
Tableviewcell 加载nib文件
staticNSString *CellIdentifier =@"Cell"; //cell是个标识符
UITableViewCell*cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell ==nil) {
cell = [[[NSBundlemainBundle]loadNibNamed:@"Cell"owner:selfoptions:nil]lastObject];
cell.selectionStyle=UITableViewCellSelectionStyleNone;
更高单元格高度
- (CGFloat)tableView:(UITableView*)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
设置navigation的左右button
self.navigationController.navigationBar.tintColor = [UIColorgreenColor];;
self.navigationItem.rightBarButtonItem=BARBUTTON(@"Right",@selector(rightAction:));
self.navigationItem.leftBarButtonItem=BARBUTTON(@"Left",@selector(leftAction:));
发送NSnotification带数据
// Posting Notification with userinfoNSDictionary *orientationData;if(iFromInterfaceOrientation == UIInterfaceOrientationLandscapeRight) { orientationData = [NSDictionary dictionaryWithObject:@"Right" forKey:@"Orientation"];}NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];[notificationCenter postNotificationName:@"Abhinav" object:nil userInfo:orientationData];// Adding observer[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(orientationChanged) name:@"Abhinav" object:nil];
- (void)orientationChanged:(NSNotification *)notification{ NSDictionary *dict = [notification userInfo];}
- codecut iphone开发速查
- iPhone全部设备分辨率速查
- iPhone 开发 之-SQLite3-增删改查
- nodejs package开发速查
- IPHONE开发
- iphone开发
- iphone开发
- iphone开发
- IPHONE开发
- iphone 开发 --。。。
- iphone数据库增删改查
- iphone 查激活时间
- 低成本游戏开发SDK状态速查
- Android程序开发技巧速查
- Linux 开发闲杂知识点速查
- 租用iPhone开发开发最新iPhone框架
- 用iPhone上网查股票行情设置办法
- 查iphone url schemes的好地方
- 3.求子数组的最大和
- Xshell输入enter全屏的问题解决
- checkbox选课(限选5个,之后不能选择,取消后才可以选)
- hibernate映射主键 id
- 单片机常识——结构和相关公司
- codecut iphone开发速查
- Android GPS
- 对Dom的复习
- __attribute__ ((packed)) 的作用
- 学习摘录
- Android学习笔记之AndroidManifest.xml文件解析
- 最大流问题:增广路径算法的比较之序
- VB实验报告
- MANIFEST.MF文件