Magic Studio

专心做有逼格的APP!

上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 42 下一页

2014年1月10日 #

How do I avoid capturing self in blocks when implementing an API?

摘要: Short answerInstead of accessingselfdirectly, you should access it indirectly, from a reference that will not be retained.If you're not using Automatic Reference Counting (ARC), you can do this:__block MyDataProcessor*dp = self;self.progressBlock =^(CGFloat percentComplete){[dp.delegate myAPI:dp 阅读全文

posted @ 2014-01-10 18:51 Mr 布鲁斯 阅读(317) 评论(0) 推荐(0) 编辑

2013年12月17日 #

Android Logging

摘要: Here is HauteLook’s logger class from our Android Code Library. It displays class name, method name and line number per line of log message.?123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 阅读全文

posted @ 2013-12-17 18:05 Mr 布鲁斯 阅读(199) 评论(0) 推荐(0) 编辑

2013年11月29日 #

Creating Custom UITableViewCells with NIB files

摘要: Maksim Pecherskiy13 November 2012Well this sucks. Apparently these days you can only use the Interface Builder to design your cell in XCode if you're using Storyboards. But no worries. I have found a workaround which plays very nicely in iOS5+. Let's get to it!I'm assuming you already kn 阅读全文

posted @ 2013-11-29 21:51 Mr 布鲁斯 阅读(396) 评论(0) 推荐(0) 编辑

Status bar and navigation bar appear over my view's bounds in iOS 7

摘要: 186down votefavorite122I recently downloaded Xcode 5 DP to test my apps in iOS 7. The first thing I noticed and confirmed is that my view's bounds is not always resized to account for the status bar and navigation bar.InviewDidLayoutSubviews, I print the view's bounds:{{0, 0}, {320, 568}}Thi 阅读全文

posted @ 2013-11-29 14:55 Mr 布鲁斯 阅读(5239) 评论(0) 推荐(0) 编辑

ios7 - Custom UItabbar has a gap in the bottom

摘要: 3down votefavoriteIm trying to create a custom UITabbar using images for the selected and unselected states.this is my code:if([UIImage instancesRespondToSelector:@selector(imageWithRenderingMode:)]){ tab_01_on_image =[[UIImage imageNamed:@"Tabbar_on_01"] imageWithRenderingMode:UIImageRend 阅读全文

posted @ 2013-11-29 13:07 Mr 布鲁斯 阅读(473) 评论(0) 推荐(0) 编辑

2013年11月28日 #

iPhone Development – core data relationships tutorial part 1

摘要: I’m going to start a short series on Core Data relationships and maybe throw in some general Core Data stuff too. Here in part one we’re just going to set our app up with core data and add two entities with a simple one to one relationship between them. A one to one relationship means that for every 阅读全文

posted @ 2013-11-28 01:19 Mr 布鲁斯 阅读(431) 评论(0) 推荐(0) 编辑

2013年11月27日 #

iOS应用开发之CoreData[转]

摘要: 我目前的理解,CoreData相当于一个综合的数据库管理库,它支持sqlite,二进制存储文件两种形式的数据存储。而CoreData提供了存储管理,包括查询、插入、删除、更新、回滚、会话管理、锁管理等一系列数据库操作。另外,开发者还可以在xcode中使用 .xcdatamodel 扩展名的文件,以图形化的形式编辑数据模型,这里包括了Entities、Properties、Attributes、Relationships四个概念,这里跟关系型数据库有很大的相似点。下面来看一下CoreData的框架。一次来了解一下 PersistentStore、DataModel、PersistentStore 阅读全文

posted @ 2013-11-27 21:46 Mr 布鲁斯 阅读(341) 评论(0) 推荐(0) 编辑

iOS应用开发之Persistence持久化[转]

摘要: 持久化(Persistence)持久化(Persistence)意思就是当你退出app的时候它还会存在。NSUserDefaults就是一个非常简单的持久化方案,不过这有限制,它只能是很小的东西,通常是些用户选项。如何把那些大数据的东西持久化?第一个方法,把东西持久化的第一个简单的方式有点像用NSUserDefaults里的property list来实现的进化版,property list是我们自定义的一个概念,是NSArray、NSDictionary、NSNumber、NSString、 NSDate和NSData的组合。所有以上这些都有API可以用来保存,NSUserDefaults也 阅读全文

posted @ 2013-11-27 21:43 Mr 布鲁斯 阅读(590) 评论(0) 推荐(0) 编辑

iOS基础教程:在建好的项目中加入CoreData[转]

摘要: 这几天在做一个ios的小项目,项目中需要对数据进行基本的增删改查操作。于是就想用一把CoreData。但在创建项目初期,没有包含进CoreData。于是就在已建好的项目中加入CoreData。由于第一次用CoreData,各方面还不是很熟悉,在网上爬文,找到了一篇关于这方面的文章(http://www.iteye.com/topic/1017633)。于是,自己在这篇文章的基础上经过一天的研究,特把自己出错的地方进行简单的总结。并把步骤完善一下。1.如果想在已建好的项目中加入CoreData,首先需要引入CoreData FrameWork。这里需要先点击target,然后再点击Build P 阅读全文

posted @ 2013-11-27 21:40 Mr 布鲁斯 阅读(349) 评论(0) 推荐(0) 编辑

2013年11月24日 #

iOS开发--使用lipo命令制作模拟器与真机通用静态库

摘要: 通常在项目中使用静态库的时候都会有两个版本,一个用于模拟器,一个用于真机,因为Mac和iPhone的CPU不同,才造成了这种情况。为了模拟器与真机之间切换调试的方便,制作通用版本非常有必要。现在有两个版本的静态库libSQLite_i386.a(模拟器)与libSQLite_arm.a(真机)。1、打开终端,进入到这两个文件所在的目录;2、执行:lipo -create libSQLite_i386.a libSQLite_arm.a -output libSQLite.a,这时文件就会多出libSQLite.a,这个文件即为通用静态库。我们可以lipo -infolibSQLite.a命令, 阅读全文

posted @ 2013-11-24 14:13 Mr 布鲁斯 阅读(384) 评论(0) 推荐(0) 编辑

上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 42 下一页

导航