UA-17470720-3

Jump to content


Photo
- - - - -

Swift 3 CoraData code sample


  • Please log in to reply
2 replies to this topic

#1 stefanhp

stefanhp

    Starting Out

  • STV 5.0 Pro
  • Pip
  • 4 posts
Reputation: 2
Good

Posted 08 October 2016 - 11:33 PM

Hi,

Would it be possible to get a code only sample, in Swift 3 (Xcode8, iOS 10) for STV + CoreData ?

The user manual is heavily focused on the IB plugin, but since it's no longer supported in Xcode8 (and an unsigned Xcode8 is not an option for me) it's impossible to open/build the sample code.
Also, the example does not show how to do it in code only.

Thanks,
Stefan

#2 Dave Guerin

Dave Guerin

    Forum Master

  • STV 5.0 Pro
  • PipPipPipPipPipPipPip
  • 521 posts
  • LocationIreland
Reputation: 132
Popular

Posted 11 October 2016 - 04:34 AM

Hi Stefan,

 

I have Objective C apps with STV and Core Data working fine with Xcode 8 and iOS 10.

 

I just tried updating the Core Data App from STV 3.4.2 to STV 5.3.0 but it crashes at launch with:

 

[SCObjectSelectionAttributes attributesWithObjectsEntityDefinition:usingPredicate:allowMultipleSelection:allowNoSelection:]: unrecognized selector sent to class 0x10a4befb0
 

at the line:

 

    SCObjectSelectionAttributes *selectionAttribs = [SCObjectSelectionAttributes attributesWithObjectsEntityDefinition:categoryDef usingPredicate:nil allowMultipleSelection:NO allowNoSelection:NO];

 

which is a bit strange. Not sure what's happening there.

 

 

Note that you will probably have to add the Apple AssetsLibrary.framework to the project to get it to build at all.

 

 

It should also be possible to follow the examples in the PDF:

 

http://sensiblecocoa...e-tableview-30/

 

although I haven't tried it.

 

 

 

As to Swift 3.... I have Objective C projects that include Swift 2.x code that I've now got to move to Swift 3, but I've never tried it the other way around, Swift including Objective C frameworks.

 

 

Hopefully Tarek will be along in a while with more information.


Cheers,

Dave

www.dgapps.ie

#3 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 441
Popular

Posted 31 October 2016 - 04:30 PM

Hi guys,

 

We're currently considering several changes to STV to enable you to use it from IB without requiring an Xcode plugin at all. For instance, placing the string "{SCArrayOfObjectsSection}" anywhere in a section's footer in IB could tell STV to convert it into an SCArrayOfObjectsSection at runtime. You will also be able to add static cells in IB and STV will convert those into STV cells. It won't be wise for us to provide any new docs or samples before all these changes are finalized.

 

Thank you so much for all your feedback.


  • wizgod likes this




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users