root/apps/iphone/superbook/trunk/Classes/SBContact.m
@
902
| Revision 873, 2.1 kB (checked in by henri, 22 months ago) |
|---|
| Line | |
|---|---|
| 1 | // |
| 2 | // SBContact.m |
| 3 | // Superbook |
| 4 | // |
| 5 | // Created by Henri Asseily on 7/13/11. |
| 6 | /* |
| 7 | Copyright (c) 2008-2011, Telnic Ltd. All rights reserved. |
| 8 | |
| 9 | Redistribution and use in source and binary forms, with or without modification, |
| 10 | are permitted provided that the following conditions are met: |
| 11 | |
| 12 | Redistributions of source code must retain the above copyright notice, this list of conditions |
| 13 | and the following disclaimer. Redistributions in binary form must reproduce the above copyright |
| 14 | notice, this list of conditions and the following disclaimer in the documentation and/or other |
| 15 | materials provided with the distribution. |
| 16 | Neither the name of the Telnic Ltd. nor the names of its contributors may be used to endorse or |
| 17 | promote products derived from this software without specific prior written permission. |
| 18 | THIS DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS |
| 19 | OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY |
| 20 | AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR |
| 21 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 22 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 23 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER |
| 24 | IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
| 25 | OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 26 | */ |
| 27 | |
| 28 | #import "SBContact.h" |
| 29 | |
| 30 | |
| 31 | @implementation SBContact |
| 32 | |
| 33 | @synthesize name, loc, locTimestamp, telDomain, distanceFromDevice; |
| 34 | |
| 35 | - (SBContact *)init { |
| 36 | if ((self = [super init])) { |
| 37 | self.name = nil; |
| 38 | self.telDomain = nil; |
| 39 | self.loc = nil; |
| 40 | self.locTimestamp = nil; |
| 41 | self.distanceFromDevice = NSIntegerMax; |
| 42 | } |
| 43 | return self; |
| 44 | } |
| 45 | |
| 46 | - (BOOL)hasLocation { |
| 47 | if (self.loc != nil) { |
| 48 | return YES; |
| 49 | } |
| 50 | return NO; |
| 51 | } |
| 52 | |
| 53 | - (NSComparisonResult)compositeNameSortAlgorithm:(SBContact *)otherContact { |
| 54 | return [self.name localizedCompare:otherContact.name]; |
| 55 | } |
| 56 | |
| 57 | @end |
Note: See TracBrowser
for help on using the browser.








