This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Class class = NSClassFromString(className); | |
if (!class) | |
{ | |
// Class was not found. Maybe it's a Swift class? | |
// See http://stackoverflow.com/questions/24030814/swift-language-nsclassfromstring | |
NSString *appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"]; | |
NSString *classStringName = [NSString stringWithFormat:@"_TtC%lu%@%lu%@", (unsigned long)appName.length, appName, (unsigned long)className.length, className]; | |
class = NSClassFromString(classStringName); | |
} | |
if (!class) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Cocoa | |
import Foundation | |
var str = "Hello, playground" | |
var task:NSTask = NSTask() | |
var pipe:NSPipe = NSPipe() | |
task.launchPath = "/bin/ls" | |
task.arguments = ["-la"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import commands | |
import re | |
def get_codesign_entries_from_keychain(): | |
cm = 'security find-identity -v -p codesigning' | |
result = commands.getoutput(cm) | |
entries = [] | |
if result: | |
items = result.split('\n') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
class MainScene: CCNode { | |
let audio:OALSimpleAudio = OALSimpleAudio.sharedInstance() | |
override func onEnter() { | |
audio.playBg("bgm.mp3", loop: true) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
class MainScene: CCNode { | |
let audio:OALSimpleAudio = OALSimpleAudio.sharedInstance() | |
override func onEnter() { | |
self.userInteractionEnabled = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
class MainScene: CCNode { | |
override func onEnter() { | |
self.userInteractionEnabled = true | |
super.onEnter() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSString * const CCFileUtilsSuffixDefault = @"default"; | |
NSString * const CCFileUtilsSuffixiPad = @"ipad"; | |
NSString * const CCFileUtilsSuffixiPadHD = @"ipadhd"; | |
NSString * const CCFileUtilsSuffixiPhone = @"iphone"; | |
NSString * const CCFileUtilsSuffixiPhoneHD = @"iphonehd"; | |
NSString * const CCFileUtilsSuffixiPhone5 = @"iphone5"; | |
NSString * const CCFileUtilsSuffixiPhone5HD = @"iphone5hd"; | |
NSString * const CCFileUtilsSuffixMac = @"mac"; | |
NSString * const CCFileUtilsSuffixMacHD = @"machd"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var chara = CCSprite(imageNamed: "images/image.png") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
class MainScene: CCNode { | |
override func onEnter() { | |
var winSize = CCDirector.sharedDirector().designSize | |
var chara = CCSprite(imageNamed: "images/image.png") | |
self.addChild(chara) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
class MainScene: CCNode { | |
override func onEnter() { | |
var sp = CCSprite(imageNamed: "iPhone.png") | |
self.addChild(sp) | |
sp.position = ccp(200,200) |
NewerOlder