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
# This needs to go into a script build phase prior to "Copying resources" | |
# Set the version from version.txt | |
product_version=`cat version.txt` | |
# Instead of version.txt, you can use whatever your filthy heart desires | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion \"$product_version\"" "$TARGET_BUILD_DIR/$INFOPLIST_PATH" | |
exit 0 |
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
# Configure less to register the represented file with the terminal. | |
if [[ "$TERM_PROGRAM" == "Apple_Terminal" ]] && [[ -z "$INSIDE_EMACS" ]]; then | |
export LESS='-P?n?f'"$(printf '\e]6;%%f\a')"'%f .?m(file %i of %m) ..?e(END) ?x- Next\: %x..%t' | |
fi | |
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
BOOL compilerSwitch = NO; | |
#ifdef __FOOCOMPILERDEFINE__ | |
compilerSwitch = YES; | |
#endif | |
if (compilerSwitch || [self someOtherActivationLikeInAppPurchaseOrYouNameIt]) { | |
[MrScott energize]; | |
} |
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
** TEST SUCCEEDED ** | |
[FOO] $ /bin/bash -xe /var/folders/kx/gv59n06j26n3n1fwxsxctb_m0000gq/T/hudson2864317743272309338.sh | |
Recording test results | |
No test report files were found. Configuration error? | |
Build step 'Publish JUnit test result report' changed build result to FAILURE | |
Finished: FAILURE` |
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
I would think my question is pretty easy, as what I am trying to do seems like a very common use case. | |
There are two entities, "Speaker" and "Session". And the Speaker has a to-many relationship, "sessions", with an inverse in the Session entity. So a Speaker can be related to many sessions, and a Session can have many speakers. | |
My problem is in the UI: I have an NSArrayController, "SpeakerSessionController", its purpose is to show the sessions currently associated with the selected speaker. So the goal was to set its content array to the sessions key of the selection of my "SpeakerController". That does not work natively (neither does setting the content set), so I threw in a value transformer to transform the _NSMutableFaultingSet to an NSArray. | |
So far, so good. I can now add a session to the speaker it seems, putting a breakpoint into the value transformer shows me that there is an object. | |
But it is not shown in the table view that should be listing all the sessions for the selected speaker. Where am I |
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 | |
var str = "https://github.com/robelkin/altconf-data/raw/master/sessions.json" | |
let url = NSURL(string:str) | |
var error : NSErrorPointer = nil | |
if (url != nil) { | |
let jsonData = NSData(contentsOfURL: url!, options: .Data, error: error) | |
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 trust : Unmanaged<SecTrust>? | |
let status : OSStatus = SecTrustCreateWithCertificates(nil, nil, &trust) | |
let certificate = SecTrustGetCertificateAtIndex(trust?.takeUnretainedValue(), 0) | |
let serverCertData = SecCertificateCopyData(certificate).takeUnretainedValue() | |
/* | |
error: cannot convert the expression's type 'CFData' to type '$T6' | |
let serverCertData = SecCertificateCopyData(certificate).takeUnretainedValue() | |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~ | |
*/ |
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
- (void) bar { | |
SEL selector = @selector(foo); | |
typedef void (send_type) (id, SEL); | |
send_type func = (send_type)objc_msgSend(); | |
func (self, selector); | |
} | |
foobar.m:25:22: error: used type 'send_type' (aka 'void (__strong id, SEL)') where arithmetic or pointer type is required | |
send_type func = (send_type)objc_msgSend(); |
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
// Playground - noun: a place where people can play | |
import Cocoa | |
import XCPlayground | |
let path = XCPSharedDataDirectoryPath + "log.txt" | |
let fileURL = NSURL(fileURLWithPath: path) | |
if (fileURL != nil) { | |
var error : NSError? = nil; | |
let fileHandle = NSFileHandle(forWritingToURL: fileURL!, error:&error) |
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 UIKit | |
protocol myProtocol { | |
func dothatthing () -> Void | |
} | |
var array : [protocol<myProtocol>] = [] | |
class A : myProtocol { | |
func dothatthing() { |
OlderNewer