Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

teguh123

macrumors member
Original poster
Mar 22, 2011
62
0
This is a rough VB.net object I want to translate.

Class Restaurant
Public Property Title As String
Public Property BuildingAddress As String
Public Property Street As String
Public Property Districts As Generic.List(Of String)
Public Property City As String
Public Property Country As String

Public Property LatitudeLongitude As LatitudeLongitude
Public Property Rating As Rating
Public Property imageUrls As Generic.List(Of String)
Public Property URLs As Generic.List(Of String)
Public Property CurrentlyWorkedURL As String

Public Property Reviews As Generic.List(Of Review)
Public Property ZIP As String
Public Property Categories As Generic.List(Of String)
Public Property Phone As String
Public Property Website As String
Public Property Email As String
Public Property Price As String
Public Property openingHour As String
Public Property Promotions As Generic.List(Of Promotion)
Public Property SomethingWrong As Boolean
Public Const ProfileFile As String = "profiles.txt"
Public Shared Splitter As Char() = " ,.'()#-/&;""".ToCharArray
Public Shared WordCount As Generic.Dictionary(Of String, Double)

Now, the District relationship.

Should I create an entity named District and then set up a one to many relationship between Restaurants and Districts?

However, District is just a string. It's kind of cumbersome to create another entities whose type is NSString. Also is it possible since NSString is not decended from NSManagedObject.

How to best implement attributes where one object can have many attributes.

Think about Employee classes with one name and multiple aliases. How would you implement that in core?
 

teguh123

macrumors member
Original poster
Mar 22, 2011
62
0
If teguh123 had a dime for every time someone has told him to read that document, he could hire someone else to do this programming for him.

I read that and I think that's the wrong way to do it. I used coredata instead. I do not want to create all the classes from scratch.

Actually this one is solved. My next quest is how to download data from the web and then populate that CoreData somehow
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.