///当_headerImageV.layer.cornerRadius的值是图片的长宽的 一半的时候是圆。
_headerImageV.layer.cornerRadius = 20.0f;
_headerImageV.layer.masksToBounds = YES;
[cell.myButton setImage:[UIImage imageNamed:@"cai.png"] forState:UIControlStateNormal];
[cell.myButton setTitle:@"查" forState:UIControlStateNormal];
[cell.myButton setImageEdgeInsets:UIEdgeInsetsMake(10,10,10,10)];
UITouch *touch = [touches anyObject];
UIView *view = (UIView*)[self.view viewWithTag:100];
CGPoint point = [touch locationInView:self.view];
将中缀表达式转换为二叉树输出
首先普通的表达式都应该是中缀表达式,比如:a+b, a*b-c, a+b-c 等等,所有的符号运算都应该在有孩子的结点上,而数字应该在叶子结点上。
根据这个结论和符号的优先级
比如上面的例子,a+b我们可以把a,看作是+的左孩子,b看作+的右孩子,而a*b-c 则可以把a*b 看作-的左孩子,把c看作-的右孩子,然后再把a看作*的左孩子,b看作*的右孩子,
如果是第三种,则把a+b看作一个整体。
按照这样的规律,依次类推。
这样一来把优先级分为,+,-最高,* / 次之, ()最低,当遇见相同的优先级时,按最后的那个最大,就如上面的第三个例子。
这里最主要的是在表达式中找到某一个符号或者数字在二叉树中的位置下标。所以说问题分为主要两步,第一步,找到二叉树中按照顺序的下标的位置对应的表达式中的元素。第二步,根据第一步找到的位置构建二叉树。
第一步:如果表达式最外层是一个括号则去掉。否则从头循环如果在括号外边的+,-则标记tag,如果是* /则也标记tag。目的就是在固定的范围内找到优先级最高的那个tag。
第二步:用递归的方法,先取出第一步中的tag然后根据tag把二叉树依次赋值。
用三种方法输出二叉树就简单了。一个递归就行了。
//当搜索栏中的内容变化时就刷新。和点击搜索刷新的方法写法一样。
- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText{
NSPredicate *p=[NSPredicate predicateWithBlock:^BOOL(id evaluatedObject, NSDictionary *bindings) {
NSString *s=evaluatedObject;
return ([s rangeOfString:searchBar.text options:NSCaseInsensitiveSearch].location!=NSNotFound);
}];
// NSPredicate *p=[NSPredicate predicateWithFormat:@"self contains %@",searchBar.text];//和上面那个方法差不多,都行。
self.filteredStudentArray=[studentNameArray filteredArrayUsingPredicate:p];
[self.sdc.searchResultsTableView reloadData];
}
图片框圆角处理(UIImageView):
添加QuartzCore.framework
导入库头文件
#import “QuartzCore/QuartzCore.h”
//圆角设置
imageView.layer.cornerRadius = 8;(值越大,角就越圆)
imageView.layer.masksToBounds = YES;
//边框宽度及颜色设置
[imageView.layer setBorderWidth:2];
[imageView.layer setBorderColor:[UIColor blueColor]]; //设置边框为蓝色
//自动适应,保持图片宽高比
imageView.contentMode = UIViewContentModeScaleAspectFit;
myTableVC = (MyLikeViewController *)[tableV nextResponder];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
tableV=(UITableView *)[self superview];
self.path=[tableV indexPathForCell:self];
UITouch *aTouch=[touches anyObject];
point=[aTouch locationInView:self];
myTableVC = (MyLikeViewController *)[tableV nextResponder];
//判断是否是长按。
int tag=0;
for(int i = 0; i < [aTouch.gestureRecognizers count] ;i ++){
UIGestureRecognizer *gesture = [aTouch.gestureRecognizers objectAtIndex:i];
if([gesture isKindOfClass:[UILongPressGestureRecognizer class]]){
if (([myTableVC.dataArray count]%2==1)&&(point.x>170)&&(path.row<[myTableVC.dataArray count]/2)) {//当数量的奇数的时候,并且在右半部分,并且不是右下角。
tag=1;
}else if (([myTableVC.dataArray count]%2==0)&&(point.x<150||point.x>170)){//当数量是偶数的时候,并且左右都行。
tag=1;
}else if (([myTableVC.dataArray count]%2==1)&&(point.x<150)){//当数量是奇数的时候,并且在左半部分
tag=1;
}
if (tag==1) {
alert = [[UIAlertView alloc]initWithTitle:@"确定删除吗" message:nil delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];
alert.delegate=self;
[alert show];
}
}
}
}
//section里面的内容。
-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
UILabel *shopNameLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, 3, 100, 30)];
shopNameLabel.backgroundColor = [UIColor clearColor];
shopNameLabel.text = @"金融街店";
shopNameLabel.textColor = [UIColor whiteColor];
UILabel *shopAddressLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, 35, 300, 20)];
shopAddressLabel.backgroundColor = [UIColor clearColor];
shopAddressLabel.text = @"北京市西城区金融大街甲26号顺成饭店首层";
[shopAddressLabel setFont:[UIFont fontWithName:@"Arial" size:13]];
shopAddressLabel.textColor = [UIColor whiteColor];
UIView *sectionView=[[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.bounds.size.width, 70)];
[sectionView setBackgroundColor:[UIColor grayColor]];
[sectionView addSubview:shopNameLabel];
[sectionView addSubview:shopAddressLabel];
[shopNameLabel release];
[shopAddressLabel release];
这里的sectionView 应该用autorelease,不应该什么都不用。
return sectionView;
}
self.myTableView.backgroundView = nil;
id_rsa id_rsa.pub
ssh zhangmw@192.168.201.11
ls -a 看全部文件. ls -lh 更友好的看。
pwd 看路径。 cd . 默认进入自己的路径。
mkdir - p cc/dd/ee 批量新建文件夹。
rm z在window中是del 是删除文件。
rm - r rm -fr 不提示的删除。
cp 复制文件。
cp a.php b.php 复制a.php cp a.php aaa/
rm -rf
cat 看文件的内容。不能看二进制的文件例如world文档。
vim也是看文件内容。
echo "hello world!"里面的符号需要转义。
find 看目录中的文件查找,touch 建立空白的文件。 touch a.php
mkdir 是创建文件夹。
grep 在文件中找固定的字符串。
grep "md3" a.php
ls -lh | grep "smb.conf" 意思是查找前面结果中的smb.conf 文件。
上面是管道的用法。
git init 创建一个空白的git路径。
ls -lha
touch a echo "hello" > a
cat a 查看a 里面的内容。
git status 查看目前git的状态。
git add a b c 分别把a b c 都加入进去。
git log 查看版本。 git reset --hard 版本号 恢复到指定的版本号中。git reset --mixed 版本号,意思是清理版本。
git rm a 删除a。
git clone git@code.meijika.com:ios/app.ios.codes/ 就是克隆一个git 到当前目录中。
git pull 获取fu服务器中最新的版本。
从vim中退出是 先按esc键,再按:wq 就是保存并退出。
相关推荐
高通vuforia-unity-mobile-android-ios-4-0-5-beta
instant-opencv-for-ios--ebook instant-opencv-for-ios--ebook instant-opencv-for-ios--ebook instant-opencv-for-ios--ebook instant-opencv-for-ios--ebook
压缩包子文件的文件名称列表“H264-RTSP-Server-iOS-master”暗示这可能是一个开源项目,其代码库可能包含了服务器端的实现、客户端的SDK或者其他相关资源,供开发者研究和定制。 综上所述,这个项目涉及到iOS设备...
总结,ios-cmake-master项目为iOS开发者提供了一套完整的CMake构建解决方案,通过它,我们可以更方便地进行跨平台开发,避免了手动配置各种构建参数的繁琐工作。熟悉并掌握CMake的使用,对于提升iOS项目的构建效率...
最全最新版 Objective-C编程之道IOS设计模式解析.pdf
A-Star-algorithm-for-iOS, iOS的星型算法实现 A-Star-algorithm-for-iOS面向iOS的A*搜索算法。适用于 5/iOS 6,完全工作在 iOS 7中。目标A*搜索算法的实现。学校项目由 Klein的@ ITESCIA 为项目制作。 CAZENAVE 。
cocos2d-iOS是一款强大的2D游戏开发框架,专为iOS平台设计,适用于初学者和经验丰富的开发者。它基于开源的cocos2d-x项目,提供了丰富的功能集,包括场景管理、精灵动画、粒子系统、触摸事件处理、物理引擎集成等,...
ios-webkit-debug-proxy-1.9.0-win64-bin
line-sdk-starter-ios, 演示在线 iOS SDK用法的starter应用程序 重要通知这个启动应用程序适用于LINE版,因为这些版本的SDK将在 2018年06月的末尾终止,请使用 ...请参阅 htt
vuforia-samples-core-android-ios-unity-4-2-3.zip 原始资源420多兆,官网下载太慢,放在网盘里供下载
vuforia-samples-advanced-android-ios-unity-4-2-3.zip官网下载太慢了,放在网盘方便大家下载
"popcorn-time-remote-control-ios"的源代码位于"popcorn-time-remote-control-ios-master"文件夹中,包含了完整的项目结构和文件,可供开发者参考和学习。通过研究这个项目,开发者不仅可以掌握 Objective-C 的实际...
CCNA资源---操作与配置Cisco IOS设备:讲关于操作与配置Cisco IOS设备方面的东东
如果AP当前是瘦AP,可用此IOS文件刷成胖AP。 注意:适用于思科1600系列型号AP。 AIR-CAP1602I-C-K9胖IOS,cisco 1600系列通用。
这是一份 iOS 基础学习资料,内容丰富全面。其详细介绍了 iOS 的架构,包括 Core OS、Core Services、Media、Cocoa Touch 四层架构的功能与组件,如 Core OS 层的内核及安全框架等。 在安全特性上,从硬件、软件、...
vuforia-unity-android-ios-2-8-7 unity vr摄像机下载
Use the Vuforia SDK to build mobile vision applications for Android and iOS. Apps can be built with Eclipse (Java/C++), XCode (C++) and Unity - the cross-platform game engine.
Objective-C 2.0 Mac和iOS开发实践指南
Appium-Python-Client是用于自动化测试iOS应用的Python库,它允许开发者通过Python编写测试脚本来控制Appium服务器。这个库的版本是0.22,表明它是针对Appium的一个较新的兼容版本,适用于iOS环境。在iOS测试场景中...