nspragmatic
Joined 15 years ago
Joined 15 years ago
> "Avaliable (sic) in Ruby and Perl, but supports all languages!"
It was in 1997. Apple wasn't doing so well at the time.
return 0; // <stdlib.h> not #imported
}> All I want to point out is that there is no way for anyone here on HN to know what it was for sure
Take another look at the last sentence. :P
NSString *pattern = @"\\d", *string = @"੧";
NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:pattern
options:NSRegularExpressionCaseInsensitive
error:nil];
NSUInteger numMatches = [regex numberOfMatchesInString:string
options:0
range:NSMakeRange(0, [string length])];
numMatches ? NSLog(@"%@ found by %@", string, pattern) : NSLog(@"%@ not found", string);
// 2013-05-20 09:38:42.650 Regexperiment[17848:c07] ੧ found by \dhttps://developer.apple.com/library/ios/#releasenotes/Genera...
FTFY :)
> swizzling happens only once at compile time.
Objective-C is a dynamic language in every sense of the term.
As examples, at runtime, you can:
- change an existing class' superclass - swizzle methods - create a class ex nihilo (though it'd be a better idea to inherit from NSObject) - give that class (or even an existing one) methods, ivars, and properties
.. and much more
Visit the runtime reference[1] and jump into a running Objective-C app with GDB or F-Script. It's a lot of fun.
[1] https://developer.apple.com/library/mac/#documentation/Cocoa...
This is the HIG quote from above:
> "In general, quit when users close the last open window in your app. [...] If users close the last remaining document window in a document-based app and switch to another app, it’s appropriate to quit the app" (emphasis added).
In TextEdit, close the last document and then _switch to another app_. You're missing the last step.
This is incorrect - the NS prefix was introduced in NEXTSTEP along with EOF.
It would've been nice to have an 'I don't care, proceed anyway' button. The check excludes Safari 7, which runs the demo just as well as Chrome.
http://jsfiddle.net/bYHfh
^ removes the hasWebGLSupport() invocation.
Very nice demo, though!