Having an id member

On the server side of my soon to be released application (haha), I have an id field in all my tables. This is the foreign key used by all the relationships. On the iPhone id is a type and although it can also be a variable name I avoided using it in my initial implementation of the code. Instead I use _id for the sqlite3 tables and the mapped objects.

This is an inconsistency that has been nagging me since the first day on this project. I will likely try to eliminate it by moving the iPhone code to also use id as the variable name. This is just a heads up for now.

Also coming soon some initial implementation of delete with where arguments, currently only delete of all the records is implemented.

Advertisement

1 Comment »

  1. iphonelite3 said

    One annoyance with having a property named id is that you can cannot @synthesize it. You can however define the setter and getter explicitly like in:


    -(int)id {
    return self->id;
    }

    -(void)setId:(int)n {
    self->id = n;
    }

RSS feed for comments on this post · TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.