
Nshipster专栏
呆萌院长
创业公司CTO iOS主架
展开
-
Associated Objects
http://nshipster.cn/associated-objects/#import Objective-C开发者应该小心谨慎地遵循这个危险咒语的各种准则。一个很好的原因的就是:混乱的运行时代码会改变运行在其架构之上的所有代码。从利的角度来讲, 中的函数具有其他方式做不到的、能为应用和框架提供强大功能的能力。而从弊的角度来讲,它可能会会毁掉代码的sanit转载 2014-05-07 12:32:22 · 846 阅读 · 0 评论 -
Network Link Conditioner
http://nshipster.com/network-link-conditioner/Product design is about empathy. Knowing what a user wants, what they like, what they dislike, what causes them frustration, and learning to underst转载 2013-09-28 09:26:41 · 1667 阅读 · 0 评论 -
iOS 7
http://nshipster.com/ios7/With the NDA finally lifted, we can finally talk about all of the amazing new APIs in iOS 7. And there are a lot of them. "1500 new APIs", by Apple's count during the W转载 2013-09-28 09:25:14 · 2098 阅读 · 0 评论 -
Xcode Snippets
http://nshipster.com/xcode-snippets/iOS development all but requires the use of Xcode. To its credit, Xcode has improved pretty consistently over the last couple of years. Sure, it still has its转载 2013-09-28 09:27:56 · 895 阅读 · 0 评论 -
AFNetworking 2.0
http://nshipster.com/afnetworking-2/AFNetworking is one of the most widely used open source projects for iOS and Mac OS X development. It powers thousands of popular and critically acclaimed app转载 2013-09-28 09:25:58 · 1838 阅读 · 0 评论 -
NSHashTable & NSMapTable
http://nshipster.com/nshashtable-and-nsmaptable/NSSet and NSDictionary, along with NSArray are the workhorse collection classes of Foundation. Unlike other standard libraries, implementa转载 2013-09-03 11:37:45 · 1507 阅读 · 0 评论 -
Xcode Snippets
http://nshipster.com/xcode-snippets/iOS development all but requires the use of Xcode. To its credit, Xcode has improved pretty consistently over the last couple of years. Sure, it still has its转载 2013-09-03 11:34:23 · 900 阅读 · 0 评论 -
Equality
http://nshipster.com/equality/The concept of equality is a central point of debate and inquiry in philosophy and mathematics, with far-reaching implications for matters of ethics, justice, and p转载 2013-09-03 11:36:04 · 1496 阅读 · 0 评论 -
NSPredicate
http://nshipster.com/nspredicate/NSPredicate is a Foundation class that specifies how data should be fetched or filtered. Its query language, which is like a cross between a SQL WHERE clau转载 2013-08-21 11:51:11 · 1011 阅读 · 0 评论 -
UIMenuController
http://nshipster.com/uimenucontroller/Mobile usability today is truly quite remarkable—especially considering how far it's come in just the last decade. What was once a clumsy technology rel转载 2013-08-21 11:50:26 · 972 阅读 · 0 评论 -
NSHipster Quiz #3
http://nshipster.com/nshipster-quiz-3/NSHipster Pub Quiz came to New York City on July 30th. Like our first and second quizzes, questions ranged from random Apple trivia to obscure framewo转载 2013-08-21 11:49:21 · 1157 阅读 · 0 评论 -
Documentation
http://nshipster.com/documentation/There's an adage among Cocoa developers that Objective-C's verbosity lends its code to being effectively self-documenting. Between longMethodNamesWithNamed转载 2013-08-21 11:48:16 · 866 阅读 · 0 评论 -
rand(3) / random(3) / arc4random(3) / et al.
http://nshipster.com/random/What passes for randomness is merely a hidden chain of causality.In a mechanical universe of material interactions expressed through mathematical equations, it转载 2013-08-21 11:47:46 · 1202 阅读 · 0 评论 -
NSHashTable & NSMapTable
http://nshipster.com/nshashtable-and-nsmaptable/NSSet and NSDictionary, along with NSArray are the workhorse collection classes of Foundation. Unlike other standard libraries, implementa转载 2013-08-21 11:46:52 · 1380 阅读 · 0 评论 -
NSSortDescriptor
http://nshipster.com/nssortdescriptor/NSSortDescriptorWritten by Mattt Thompson on Jul 24th, 2012Sorting: the old mainstay of the exams of an intro CS class and whiteboards of an entry-l转载 2013-07-11 09:08:45 · 824 阅读 · 0 评论 -
NSUUID / CFUUIDRef / UIDevice -uniqueIdentifier / -identifierForVendor
http://nshipster.com/uuid-udid-unique-identifier/NSUUID / CFUUIDRef / UIDevice -uniqueIdentifier / -identifierForVendorWritten by Mattt Thompson on Jun 24th, 2013Let's say you're mak转载 2013-07-09 09:42:35 · 1409 阅读 · 0 评论 -
Xcode Key Bindings & Gestures
http://nshipster.com/xcode-key-bindings-and-gestures/The extent to which programming-as-craft is compared to manual disciplines like woodworking is tiresome. It's absolutely the case that one sh转载 2013-10-22 11:34:05 · 1149 阅读 · 0 评论 -
Key-Value Observing
http://nshipster.com/key-value-observing/Ask anyone who's been around the NSBlock a few times: Key-Value Observing has the worst API in all of Cocoa. It's awkward, verbose, and confusing. And wo转载 2013-10-22 11:33:50 · 997 阅读 · 0 评论 -
Launch Arguments & Environment Variables
http://nshipster.com/launch-arguments-and-environment-variables/Walk into any American fast food establishment, and you'll be greeted with a colorful, back-lit display of specials, set menus转载 2013-10-22 11:35:30 · 2408 阅读 · 0 评论 -
namespacing
http://nshipster.cn/namespacing/为什么Objecive-C中的很多类名都是NS开头的呢?我保证在你第一次给别人介绍Objective-C的时候肯定会听到这句话。就像父母要向孩子解释什么是死亡或者圣诞老人是不存在的问题一样,父母总是寄希望时间会让孩子自己找到答案。你既然这么问了,实际上NS代表了NeXTSTEP(好吧,其实是代表转载 2014-05-06 13:22:06 · 632 阅读 · 0 评论 -
NSTemporaryDirectory / NSItemReplacementDirectory / mktemp(3)
外存被用于写入可持续化保存的数据,但当数据生命周期很短时,用Objective-C操作临时文件的资料却很少(可能有,不过这些资料本身也是“临时”的)。临时文件的作用是在硬盘上简历buffer,既不会被原子化地转移到固定位置,也不会被某种合理的方式处理和销毁。需要找到文件系统上适当的位置、生成一个唯一的名字、再用完之后移动或删除文件的构思,才能去建立临时文件。寻找依赖目录转载 2014-05-06 13:19:48 · 820 阅读 · 0 评论 -
NSURL / NSURLComponents
http://nshipster.cn/nsurl/这里有一个直观的描述来解释什么是“一维数据类型”:number或string被格式化为多种多样的值,可以通过数学运算或某种转换方法可以算出它们的值。比如:十六进制的颜色值 #EE8262 的红绿蓝三原色的值通过掩码或移位运算得出;正则表达式可以通过少量字符中复杂的样本中进行匹配。在所有的一维数据类型中,URI有着至高地位。单独转载 2014-05-05 18:47:09 · 1375 阅读 · 0 评论 -
NSIndexSet
http://nshipster.cn/nsindexset/NSIndexSet (以及它的可修改子类, NSMutableIndexSet) 是一个排好序的,无重复元素的整数集合。它看上去有点像 支持离散整数的 NSRange .它能用于快速查找特定范围的值的索引,也能用于快速计算交集, 同时,Foundation collection class 提供了很多好用的方法,方便你转载 2014-05-04 18:51:31 · 694 阅读 · 0 评论 -
NSCache
http://nshipster.cn/nscache/可怜的 NSCache 一直处于 NSMutableDictionary 的阴影之下。就好像没有人知道它提供了垃圾处理的功能,而开发者们却费劲力气地去自己实现它。没错,NSCache 基本上就是一个会自动移除对象来释放内存的 NSMutableDictionary。无需响应内存警告或者使用计时器来清除缓存。唯一的不同之处是键对象不会像 NSM转载 2014-05-04 19:13:27 · 609 阅读 · 0 评论 -
Extended File Attributes
http://nshipster.com/extended-file-attributes/Amidst revelations of widespread spying by the NSA, the concept of metadata has taken an unexpected role in the national conversation about governme转载 2014-01-22 11:28:17 · 1196 阅读 · 0 评论 -
NSRange
http://nshipster.com/nsrange/NSRange is one of the essential types of Foundation. Passed around and returned in methods throughout the framework, being well-versed in this struct has a range o转载 2014-01-22 11:27:57 · 1167 阅读 · 0 评论 -
Colophon
http://nshipster.com/colophon/As a way to kick off this new year, I thought it'd be fun to share some insights of just how NSHipster is made. This article covers both the website and the recentl转载 2014-01-22 11:27:31 · 1351 阅读 · 0 评论 -
UIApplicationDelegate launchOptions
http://nshipster.com/launch-options/AppDelegate is the dumping ground for functionality in iOS.Application lifecycle management? URL routing? Notifications? Core Data incantations? Invasive转载 2013-12-20 17:53:44 · 1184 阅读 · 0 评论 -
Multipeer Connectivity
http://nshipster.com/multipeer-connectivity/As consumer web technologies and enterprises race towards cloud infrastructure, there is a curious and significant counter-movement towards connected转载 2013-12-11 09:15:02 · 1271 阅读 · 0 评论 -
NSFileManager
http://nshipster.com/nsfilemanager/NSFileManager is Foundation's high-level API for working with file systems. It abstracts Unix and Finder internals, providing a convenient way to create, rea转载 2013-11-27 16:29:22 · 1189 阅读 · 0 评论 -
NSFormatter
http://nshipster.com/nsformatter/Conversion is the tireless errand of software development. Most programming tasks boil down to some variation of transforming data into something more useful.转载 2013-11-12 13:18:06 · 765 阅读 · 0 评论 -
NSHipster Quiz #4
http://nshipster.com/nshipster-quiz-4/The fourth and final NSHipster pub quiz of the year was held in the beautiful city of Amsterdam on October 22nd, with help from the good folks at Appste转载 2013-10-29 13:43:57 · 1225 阅读 · 0 评论 -
xctool
http://nshipster.com/xctool/Control the build system, and you control the destiny of the language, its ecosystem, and community.Objective-C has changed so very much in such a very sh转载 2013-11-05 21:11:34 · 1407 阅读 · 0 评论 -
NSError
http://nshipster.com/nserror/To err is human.To NSError is Cocoa.All programs on a Unix system are a child process of another process, forking all the way from the original process, th转载 2013-10-22 11:34:54 · 2697 阅读 · 0 评论 -
NSFastEnumeration / NSEnumerator / -enumerateObjectsUsingBlock:
http://nshipster.com/enumerators/NSFastEnumeration / NSEnumerator / -enumerateObjectsUsingBlock:Written by Mattt Thompson on Jul 1st, 2013Enumeration is where computation gets intere转载 2013-07-09 09:41:23 · 1155 阅读 · 0 评论 -
KVC Collection Operators
http://nshipster.com/kvc-collection-operators/KVC Collection OperatorsWritten by Mattt Thompson on Dec 3rd, 2012Rubyists laugh at Objective-C's bloated syntax.Although we lost a fe转载 2013-07-09 08:33:12 · 818 阅读 · 0 评论 -
@
http://nshipster.com/at-compiler-directives/@Written by Mattt Thompson on Oct 8th, 2012Birdwatchers refer to it as (and I swear I'm not making this up) "Jizz": those indefinable char转载 2013-07-08 09:29:45 · 7433 阅读 · 0 评论 -
Type Encodings
http://nshipster.com/type-encodings/Type EncodingsWritten by Mattt Thompson on Feb 4th, 2013From number stations and numerology to hieroglyphs and hobo codes, there is something tr转载 2013-07-03 08:38:14 · 1211 阅读 · 0 评论 -
NSValue
http://nshipster.com/nsvalue/NSValueWritten by Mattt Thompson on Jan 28th, 2013As part of playing the role of Abraham Lincoln in the eponymous 2012 biopic, Daniel Day-Lewis would ins转载 2013-07-03 08:37:49 · 720 阅读 · 0 评论 -
Reader Submissions
http://nshipster.com/reader-submissions-new-years-2013/Reader Submissions - New Year's 2013Written by Mattt Thompson on Dec 31st, 2012In celebration of the forthcoming year++, I thou转载 2013-07-03 08:37:27 · 2567 阅读 · 0 评论