Coder Social home page Coder Social logo

Comments (4)

pepicrft avatar pepicrft commented on September 22, 2024

Hello @ransomweaver
There was something wrong in the Wiki. The fetch command should be:

let idents: [IdentityProxy]? = IdentityProxy.by("cloudUUID", equalTo: "someuuid").find() as [IdentityProxy]?

Could you try it?, I've updated it on the Wiki
Thanks for the report

from sugarrecord.

ransomweaver avatar ransomweaver commented on September 22, 2024

That works, sort of. If I pass a String var to equalTo: I get this error:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Unable to parse the format string "cloudUUID == 4457f4fe-aad5-4a1c-9109-9b5376b0acef"'
*** First throw call stack:
(
0 CoreFoundation 0x000000010a0f9f35 exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010b79ebb7 objc_exception_throw + 45
2 Foundation 0x0000000109a7b3ed _qfqp2_performParsing + 8495
3 Foundation 0x0000000109a79256 +[NSPredicate predicateWithFormat:arguments:] + 46
4 libswiftFoundation.dylib 0x000000010c17811a _TFE10FoundationCSo11NSPredicateCfMS0_Ft6formatSSGSaPSs11CVarArgType___GSqS0
+ 378
5 SRRealm 0x000000010ba992d5 TFC7SRRealm17SugarRecordFinder12setPredicatefS0_FT5byKeySS8andValueSS_S0 + 869
6 SRRealm 0x000000010baa050a TFE7SRRealmCSo9RLMObject2byfMS0_FTSS7equalToSS_CS_17SugarRecordFinder + 266
7 MyApp 0x00000001099868c9 TFFC11MyApp8AppState9syncCardsFS0_FPSs9AnyObject_T_U_FP7SRRealm18SugarRecordContext_T + 3145
8 SRRealm 0x000000010baa608e TFFC7SRRealm11SugarRecord9operationFMS0_FT12inBackgroundSb9stackTypeOS_20SugarRecordStackType7closureFT7contextPS_18SugarRecordContext__T__T_U_FT_T + 270
9 SRRealm 0x000000010ba9b217 TTRXFo__dT__XFdCb__dT
+ 39
10 libdispatch.dylib 0x000000010cff6ba6 _dispatch_call_block_and_release + 12
11 libdispatch.dylib 0x000000010d0147f4 _dispatch_client_callout + 8
12 libdispatch.dylib 0x000000010cfff15d _dispatch_root_queue_drain + 1097
13 libdispatch.dylib 0x000000010d000612 _dispatch_worker_thread2 + 52
14 libsystem_pthread.dylib 0x000000010d3acef8 _pthread_wqthread + 314
15 libsystem_pthread.dylib 0x000000010d3affb9 start_wqthread + 13

To fix that I have to double-quote the string like this:

                var idents: [IdentityProxy]? = IdentityProxy("cloudUUID", equalTo: "\"\(identUUID!)\"").find() as [IdentityProxy]?

That doesn't seem right to have to do that.

from sugarrecord.

pepicrft avatar pepicrft commented on September 22, 2024

Assigning high priority to fix it @ransomweaver , let you know when it's ready

from sugarrecord.

pepicrft avatar pepicrft commented on September 22, 2024

@ransomweaver take a look here
https://github.com/SugarRecord/SugarRecord/blob/develop/example/SugarRecordExample/Shared/Controllers/RealmTableViewController.swift#L46
In that example we fetch Realm models from the database and it's working properly.

from sugarrecord.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.