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() { |
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
// In Swift 1.1, I can use "let sideshow : Sideshow!". In Swift 1.2 it has to be a var | |
// Is this due to the change: | |
// "In an initializer, constant properties can now only assign a value once." ? | |
class Main { | |
var name : String | |
let sideshow : ImplicitlyUnwrappedOptional<Sideshow> | |
init (name : String, referenceName : String) { | |
self.name = name | |
self.sideshow = Sideshow(name: referenceName, ref: self) |
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
#include <boost/shared_ptr.hpp> | |
#include <configuration/api/IConfigurationReport.hpp> | |
namespace whisper | |
{ | |
namespace configuration | |
{ | |
using boost::shared_ptr; | |
using whisper::configuration::PConfigurationReport; |
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
Dyld Error Message: | |
Library not loaded: @rpath/libswiftCore.dylib | |
Referenced from: /private/var/mobile/Containers/Bundle/Application/AC0A08F8-3993-48F2-A1EF-9188AC8C19BA/XYZ.app/XYZ | |
Reason: no suitable image found. Did find: | |
/private/var/mobile/Containers/Bundle/Application/AC0A08F8-3993-48F2-A1EF-9188AC8C19BA/XYZ.app/Frameworks/libswiftCore.dylib: mmap() error 1 at address=0x1004E8000, size=0x0018C000 segment=__TEXT in Segment::map() mapping /private/var/mobile/Containers/Bundle/Application/AC0A08F8-3993-48F2-A1EF-9188AC8C19BA/XYZ.app/Frameworks/libswiftCore.dylib | |
Dyld Version: 353.12 |
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
/Users/below/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/net/http.rb:920:in `connect': SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError) | |
from /Users/below/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/net/http.rb:920:in `block in connect' | |
from /Users/below/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/timeout.rb:76:in `timeout' | |
from /Users/below/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/net/http.rb:920:in `connect' | |
from /Users/below/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/net/http.rb:863:in `do_start' | |
from /Users/below/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/net/http.rb:852:in `start' | |
from /Users/below/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/net/http.rb:583:in `start' | |
from /Users/below/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/net/http.rb:478:in `get_response' | |
from /Users/below/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/net/http.rb:455:in `get' | |
from export.rb:4:in `<main>' |
OlderNewer