Re: propertynameItemClass in swift

2015-09-16 Thread adam wilson
Thanks, I found the latest release 1.1.1-18 and its working fine now. Also heped to look at this project . On Wednesday, 16 September 2015 05:41:57 UTC+1, Jens Alfke wrote: > > > On Sep 15, 2015, at 3:30 PM, adam wilson > wrote: >

Re: propertynameItemClass in swift

2015-09-15 Thread Julian Paas
I've been using Swift with Couchbase Lite for a year now and I've recently upgraded my app to Xcode 7 and Swift 2.0. Its working fine, although the Couchbase Swift docs have not been updated to 2.0 yet. On Tuesday, September 15, 2015 at 6:30:32 PM UTC-4, adam wilson wrote: > > Has there been

Re: propertynameItemClass in swift

2015-09-15 Thread Jens Alfke
On Sep 15, 2015, at 3:30 PM, adam wilson > wrote: Has there been any progress on this? I'm in the process of building an iOS CBLite app with Swift and hit this issue with CBLModel and @dynamic properties... Yes, I think this was

Re: propertynameItemClass in swift

2015-09-15 Thread adam wilson
Has there been any progress on this? I'm in the process of building an iOS CBLite app with Swift and hit this issue with CBLModel and @dynamic properties... Or do the model classes still need to be Objective-C? On Tuesday, 4 November 2014 05:48:43 UTC, Jens Alfke wrote: > > Thanks for the test

Re: propertynameItemClass in swift

2014-11-03 Thread Julian Paas
I still haven't figured out how to make this work in Swift. Here's some more complete examples that show how I've tried to do it import Foundation class ArrayItem : NSObject, CBLJSONEncoding { let holding: Int init(holding: Int) { self.holding = holding }

Re: propertynameItemClass in swift

2014-11-03 Thread Jens Alfke
Thanks for the test case, Julian. You may be in terra incognita here — I haven't had a chance to get too far into Swift coding yet and haven't looked into how it interacts with CBLModel. I think my colleague Pasin is starting to investigate (he's the one who added the Swift code samples to the

Re: propertynameItemClass in swift

2014-10-15 Thread Karel-Jan Van Haute
Hey Julian you say that you have working swift code to use CBLModel and link the properties right with @NSManaged? If so, can you share a class? As an example? Thank you On Tuesday, September 16, 2014 3:23:29 AM UTC+2, Julian Paas wrote: Yes @NSManaged is the same as @dynamic and is

Re: propertynameItemClass in swift

2014-10-15 Thread Julian Paas
Here's the simplest CBLModel class I have at the moment class Team: CBLModel { @NSManaged var name: String @NSManaged var type: String class func teamsByName() - CBLQuery { let query = databaseMain.viewNamed(kCblViewTeamsByName).createQuery() return query } // Because class

Re: propertynameItemClass in swift

2014-09-16 Thread Julian Paas
I adapted that code into my test class and it does find the selector. I had trouble with the objc_msgSend because the new LLVM in Xcode has introduced strict type checking and I haven't figured out yet how to invoke it properly. Next step I suppose would be to try including the library as

Re: propertynameItemClass in swift

2014-09-16 Thread Julian Paas
I'm new enough to Swift I don't know the answers to those questions either. Its still early days and hard to find answers to a lot of questions. On Tuesday, September 16, 2014 11:46:49 AM UTC-4, Jens Alfke wrote: On Sep 16, 2014, at 7:04 AM, Julian Paas julia...@osaaru.com javascript:

propertynameItemClass in swift

2014-09-15 Thread Julian Paas
I have a CBLModel with an array of objects that implement CBLJSONEncoding, but every time I try to access the array I get fatal error: NSArray element failed to match the Swift Array Element type I have tried to implement a class method to return the class for this array as follows, but it

Re: propertynameItemClass in swift

2014-09-15 Thread Jens Alfke
On Sep 15, 2014, at 1:43 PM, Julian Paas julian.p...@osaaru.com wrote: @NSManaged var gamePlayerStats: [PlayerStats] I haven't gotten into Swift programming yet — is the @NSManaged declaration equivalent to @dynamic in Objective-C? (It needs to be, otherwise CBLModel won't recognize

Re: propertynameItemClass in swift

2014-09-15 Thread Julian Paas
Yes @NSManaged is the same as @dynamic and is working nicely for all my other simple, non-array properties. PlayerStats is a custom class that implements the CBLJSONEncoding protocol so that it can be stored as part of a Couchbase document. class PlayerStats : NSObject, CBLJSONEncoding {

Re: propertynameItemClass in swift

2014-09-15 Thread Jens Alfke
Hm. Well, you can see the code that calls that method here https://github.com/couchbase/couchbase-lite-ios/blob/master/Source/API/CBLModel.m#L475-L481. So you could try adapting that in your Obj-C class and step through it and see what happens… —Jens -- You received this message because you