自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

野草志

As you will.

  • 博客(180)
  • 资源 (2)
  • 收藏
  • 关注

翻译 iOS UserInterfaceState.xcuserstate文件在Git版本控制中不能忽略

Git可能已经开始追踪这个文件在 gitignore docs 中:停止追逐现在已经追踪的文件,使用 git rm --cached。在你的情况下应该是:git rm --cached ProjectFolder.xcodeproj/project.xcworkspace/xcuserdata/myUserName.xcuserdatad/UserInterfa

2014-12-10 00:28:32 1903

原创 iOS UITableView中异步加载图片 - 解决方案

问题背景:需要在UITableView中的每一行下载图片,之前使用placeholder,下载好后存在cache中。解决方案:方案一:使用SDWebImage:https://github.com/rs/SDWebImage如何安装及使用在git页面有详细解释,具体使用的代码:#import ...- (UITableViewCell *)tableView

2014-12-09 23:46:14 6499

转载 iOS 设置UITextView的margin,让scrollview的indicator在屏幕最右边

运行环境: iOS 7.0 以上,Xcode 6问题重述:显示一个UITextView,文字离左右两边有一定距离,但是scrollview的indicator是贴着文字的。需要将indicator置于屏幕边上,文字仍然与屏幕边相距一定距离。解决方案:步骤一:storyboard中将UITextView的约束leading space 和 trailing space设为0。步骤二:

2014-11-27 21:16:23 2214

原创 iOS "Xcode process launch failed: Security" in iPhone 6, iOS 8 -解决方案

问题重述:在iOS 8中第一次运行App,Xcode出现弹出框:“Xcode process launch failed: Security”解决方案:“If you get this, the app has installed on your device. You have to tap the icon. It will ask you if you reall

2014-11-14 23:17:54 2798

原创 iOS 在TabViewController中设置Tab Bar,且实现自定义

开发环境:Xcode 6.1 iOS 7.1.2 & iOS 8.1实现功能一,在打开APP时即显示第三个Tab对应的View;实现功能二,给每一个Tab设置图片和选中图片。- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOption

2014-11-08 01:01:23 6758

原创 iOS 在TabViewController中的一个ViewController跳转到另一个ViewController

步骤一:#import "AppDelegate.h"步骤二:在需要跳转的地方: AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate]; UITabBarController *tabViewController = (UITabBarContro

2014-11-07 00:19:05 5101

原创 iOS Core Data: 存储自定义对象 Save Custom NSObject

思路:将NSObject转化为NSData,然后将NSData存入到Core Data中现有两个自定义的类:Person和Birthday,都需要使用NSCoding,实现initWithCoder和encodeWithCoder两个方法。Core Data实现添加数据: AppDelegate *appDelegate = [[UIApplication sharedApp

2014-11-04 19:21:45 2833

原创 iOS "directory not found for option '-L/Users/.../Pods/build/Debug-iphoneos"解决方案

问题重述:在删掉原来工作空间,重新install pods之后,遇到warning:ld: warning: directory not found for option '-L/Users/.../Pods/build/Debug-iphoneos'解决方案:在Target-Build Settings中找到Search Paths-Library Search Path

2014-11-03 19:00:52 22380 1

翻译 iOS "fatal error: malformed or corrupted AST file - Xcode"解决方案

运行项目时遇见问题:fatal error: malformed or corrupted AST file: 'Unable to load module "/Users/me/Library/Developer/Xcode/DerivedData/ModuleCache/XYZYIE6ZV0OP/Darwin.pcm": file not found' note: after modi

2014-11-03 18:05:00 1705

原创 iOS "The sandbox is not in sync with the Podfile.lock"解决方案

更新Cocoapod之后出现问题:diff: /../Podfile.lock: No such file or directorydiff: Manifest.lock: No such file or directory error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or updat

2014-11-03 17:47:07 42446 2

原创 iOS 8 Apple Push Notification Service

Apple Configuration1. create Apple ID in Apple Developer Website2. check on "Push Notification" in the functionality3. configure for Push Notification in Development: create certificate3

2014-10-28 22:52:38 1762

原创 iOS iOS8中 问题"registerForRemoteNotificationTypes: is not supported in iOS 8.0 and later" 解决方案

问题重述:iOS 8中改变了通知注册的方式,如果App需要同时支持iOS 7 和 8 的话,需要首先检查selector。解决方案:在Xcode 6中- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions{ //--

2014-10-14 01:11:12 6323 2

原创 iOS 打印出视图中所有的子视图的名称

使用递归:- (void)listSubviewsOfView:(UIView *)view { // Get the subviews of the view NSArray *subviews = [view subviews]; // Return if there are no subviews if ([subviews count] == 0)

2014-10-10 22:07:03 2793

转载 iOS iOS应用PUSH功能的实现

1. push原理iOS push 工作机制可以用下图简要概括Provider:应用自己的服务器;APNS:Apple Push Notification Service的简称,苹果的PUSH服务器;push的主要工作流程是:iOS设备连接网络后,会自动与APNS保持类似TCP的长链接,等待APNS推送消息的到来;应用启动时注册消息推送,

2014-10-08 20:44:31 1407

原创 iOS 监测应用是否是第一次打开&监测应用是否已经更新

解决方案:在AppDelegate.h中的didFinishLaunchingWithOptions里面添加:- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{ // Override point for custom

2014-09-25 20:39:42 1306

翻译 iOS 在应用中播放本地视频文件

可以使用MPMoviePlayerController来播放本地视频文件1.添加 Mediaplayer framework 并且在viewcontroller中#import  2. 把视频文件拖拽到xcode中3. 获取文件存放的路径NSString*thePath=[[NSBundle mainBundle] pathForResource:@"yourVideo" of

2014-09-25 20:32:45 7054

原创 iOS Xcode为Subview设置的约束条件在iOS 8 & Xcode 6中出现异常

问题重述:为collectionview设计了一个hearderView,而这个headerView是一个自定义的myview,在这个自定义中有一个subview,它的约束条件是设置到superview的。在Xcode 6和iOS 8的组合下运行,上述的subview完全没有按照原来设计的约束,而是以从(0,0)为原点自己重置layout。但在iOS7 + Xcode 5/6 和iOS8

2014-09-25 20:20:35 2377

转载 iOS Objective-C: 获取NSArray的前几个元素

解决方案:使用subArrayWithRangeNSArray *smallArray = [largeArray subarrayWithRange:NSMakeRange(0, 10)];

2014-09-25 20:02:00 19876

原创 iOS Xcode 6: 模拟器中的键盘不显示 解决方案

解决方案:iOS Simulator -> Hardware -> Keyboard取消选择:“Connect Hardware Keyboard” 或 选择“Toggle Software Keyboard”参考:http://stackoverflow.com/questions/24420873/swift-xcode-6-keyboard-not-showi

2014-09-25 17:53:17 3270

原创 iOS 图像处理-调整图像亮度

- (UIImage*) getBrighterImage:(UIImage *)originalImage{ UIImage *brighterImage; CIContext *context = [CIContext contextWithOptions:nil]; CIImage *inputImage = [CIImage imageWithCGImage:or

2014-09-17 22:14:42 3132 1

原创 iOS 修改SearchBar的Textfiled的Cursor游标颜色和字体样式和大小;Disable输入框

因为Search Bar的游标颜色和Tint颜色是统一的,如果要想将游标的颜色设置为其他颜色,则需要到textfiled内部去修改,对于字体也是同样。实现代码:- (void)setSearchBarTextfiled:(UISearchBar *)searchBar{ for (UIView *view in searchBar.subviews){ for (i

2014-09-09 17:43:16 2500

转载 iOS 代码实现获得应用的版本号(Version/Build)

[1]概念iOS的版本号,一个叫做Version,一个叫做Build,这两个值都可以在Xcode中选中target,点击“Summary”后看到。 Version在plist文件中的key是“CFBundleShortVersionString”,和AppStore上的版本号保持一致,Build在plist中的key是“CFBundleVersion”,代表build的版本号,该值每次

2014-09-01 17:02:54 1910

原创 iOS 类文件重命名操作步骤

为class修改名字:1. 在头文件中双击选中类名:@interface之后即为类名 (不选中,则重命名选项将是disable的状态);2. 工具栏中选择 Edit-Refactor - Rename;3. 修改名字后,预览所有会发生的改动,选择需要的改动,最后Save保存。参考链接:http://stackoverflow.com/questions/992381/rename-

2014-08-26 23:15:22 4526

原创 iOS 改变字母的大小写

使用 lowercaseString,uppercaseString- (void)test{ NSString *testString = @"Hello World"; // lower case NSString *lowerCaseString1 = [testString lowercaseString]; NSString *lowerCa

2014-08-26 23:02:10 8762

原创 iOS 改变Search Bar中Scope Button中文本的颜色和字体

- (void)initSearchbar{ self.wineSearchBar.delegate = self; [self.wineSearchBar setScopeBarButtonTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor redColor], NSForegr

2014-08-26 22:49:10 3405

转载 iOS 用UIColor来构造一个UIImage

+ (UIImage *)imageWithColor:(UIColor *)color { CGRect rect = CGRectMake(0.0f, 0.0f, 1.0f, 1.0f); UIGraphicsBeginImageContext(rect.size); CGContextRef context = UIGraphicsGetCurrentContext(

2014-08-26 22:44:34 801

原创 iOS 图像处理 - 模糊图像

解决问题:将图像模糊前提:添加 CoreGraphics.framework源码:- (UIImage*) blur:(UIImage*)theImage{ // create our blurred image CIContext *context = [CIContext contextWithOptions:nil]; CIImage *inputIma

2014-08-20 23:33:53 2473

原创 iOS 图像处理 - 图像拼接

解决问题:将两个图像拼接在一起源码:- (UIImage *) combine:(UIImage*)leftImage :(UIImage*)rightImage { CGFloat width = leftImage.size.width * 2; CGFloat height = leftImage.size.height; CGSize offScreenSi

2014-08-20 23:25:16 2321

原创 iOS 图像处理-剪裁图像

解决问题:按照某一长宽比例,剪裁图片的上部和下部,保留中间的内容。当然也可以自定义需要剪裁留下的区域前提:需要添加Framework:CoreGraphics.framework代码:- (UIImage*) crop:(UIImage*)theImage{ // Get size of current image CGSize size = [theImage siz

2014-08-20 23:23:45 1125

转载 iOS 函数需要多个参数

方法一:- (NSMutableArray*)getBusStops:(NSString*)busStop :(NSSTimeInterval*)timeInterval;方法二:- (NSMutableArray*)getBusStops:(NSString*)busStop forTime:(NSSTimeInterval*)timeInterval;

2014-08-20 23:16:20 842

翻译 iOS 错误"This class is not key value coding-compliant for the key"解决方案

这个错误的出现是因为一个在File's Owner中一个已经链接的Interface Builder对象被删除或重命名了。在 Interface Builder的Files's Owner右键查看,如果看到有警告标识,就是问题的所在。下图中“aRemovedView“就有一个警告标识,这是因为我已经将它移除了,但是它还仍链接在IB中。因此就会给出错误:”Terminating

2014-08-14 20:42:01 7902

转载 iOS 为UIView设置点击监听事件

// In the view controller where you create the subviews// (not sure from your question, but I think you are adding image views to a scroll viewUIView *view = [[UIView alloc] init];UITapGestureReco

2014-08-14 19:44:06 4966

转载 iOS 模糊图像的解决方案

#import - (UIImage*) blur:(UIImage*)theImage{ // ***********If you need re-orienting (e.g. trying to blur a photo taken from the device camera front facing camera in portrait mode) // th

2014-08-14 19:40:52 1199

翻译 iOS 在TableView的Cell之间设置空白间隔空间

1.设置section的数目,即是你有多少个cell- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 3; // in your case, there are 3 cells}2.对于每个section返回一个cell- (NSInteger)tableView:(UI

2014-08-12 21:15:50 5488

转载 iOS 键盘初始化的过程有短暂延迟

http://stackoverflow.com/a/9850093Yeah, I also got a few seconds delay on the latest iPhone 4s. Don't panic. For some reasons, it only happens the first time the app is loaded from Xcode in Debug.

2014-08-08 18:05:17 1441

原创 iOS NSMutableDictionary中UIImage的存储和读取

思路:将UIImage转换成NSData,然后插入到NSMutableDictionary中,读取时,用NSData读出来,然后再转换成UIImage-存储UIImage *image = [self getPicture: id];NSData *imageData = UIImagePNGRepresentation(image);[tmpDic setObject:image

2014-08-08 17:48:20 2768

转载 iOS 关于队列线程和后台异步运行程序

dispatch_queue_t exampleQueue = dispatch_queue_create( "xmpp_message", NULL );dispatch_async(exampleQueue, ^{ NSLog(@"%s dispatched to xmpp_message", __FUNCTION__); // code for processing m

2014-08-06 18:26:17 1048

翻译 iOS ERROR: unable to get the receiver data from the DB 解决方案

这个错误通常发生在iOS7当中,可能是缓存的导致的问题。解决步骤:右击Finder,选择 Go to Folder复制上:“~/Library/Application Support/iPhone Simulator/”这回打开iPhone Simulator的文件夹,然后删除其中的7.x 文件夹翻译编辑自:http://stackoverflow.

2014-08-06 18:15:35 3532

转载 iOS 监听textfield的输入

首先:[textField addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged];qi

2014-08-04 21:01:08 4487

转载 iOS 增加textview中行间距离

在iOS 7 中:NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];paragraphStyle.headIndent = 15; // <--- indention if you need itparagraphStyle.firstLineHeadIndent = 15;

2014-07-21 22:30:09 975

新浪微博数据挖掘方案

摘 要: 随着新浪微博用户群体的增长, 新浪微博的数据获 取是微博研究首先需要解决的问题。该文提出了基于新浪 微博API 与基于页面解析的新浪微博数据获取方案。程序 逻辑控制API 调用方法与频率, 获取JSON 对象并解析实现 高效数据获取。同时将传统的网络爬虫结合网页解析技术 结合API 同时使用, 解决了因API 接口开放不完善, 且因在 返回结果数量上限与调用频率方面的限制, 导致不能有效实 现新浪微博数据的全面获取的问题。经过实验测试, 通过2 套方案的结合可以实现新浪微博数据高效全面的获取。

2012-08-28

大型共享数据库数据的关系模型

《大型共享数据库数据的关系模型》原名叫:《A Relational Model of Data for Large Shared Data Banks》是E.F Codd在1970年写的一篇论文。在数据历史上具有转折性的意义。

2012-02-18

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除