Month: October 2015

0-arity Functions: () => Type

1
2
3
4
5
6
7
8
() => println("I'm an anonymous function")  // anonymous function
 
val f: () => Unit = () => println("I'm an anonymous function")
f() // return I'm an anonymous function
 
// () => println("I'm an anonymous function") is an anonymous function
// f has type - () => Unit,
// a function takes no argument and return Unitn
Tags :

Call-by-Name: => Type

1
2
3
4
def f(x: => Int) = x * x * x
var y = 0
f { y += 1; y }
// result = 6
Tags :

[Q&A] Error Itms-90339: This bundle is invalid . The info.plist contains an invalid key ‘CFBundleResourceSpecification’ in app bundle

1. remove

1
CODE_SIGN_RESOURCE_RULES_PATH=$(SDKROOT)/ResourceRules.plist

2. modify

1
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/PackageApplication

change

1
2
3
my @codesign_args = ("/usr/bin/codesign", "--force", "--preserve-metadata=identifier,entitlements,resource-rules",
                  "--sign", $opt{sign},
                  "--resource-rules=$destApp/ResourceRules.plist");

to

1
2
my @codesign_args = ("/usr/bin/codesign", "--force", "--preserve-metadata=identifier,entitlements",
                  "--sign", $opt{sign});

3. change file permission

1
sudo chown myuser /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/ResourceRules.plist
Tags :