Developer Area

Changeset 893

Show
Ignore:
Timestamp:
09/06/11 10:22:08 (3 years ago)
Author:
henri
Message:

Fixed issues related to adding ShareKit?

Location:
apps/iphone/superbook/trunk
Files:
2 removed
19 modified

Legend:

Unmodified
Added
Removed
  • apps/iphone/superbook/trunk/DotTel_SDK/Classes/NetworkUtility.h

    r674 r893  
    3434@interface NetworkUtility : NSObject { 
    3535        NSUInteger networkActivityCounter; 
    36     NetworkStatus remoteHostStatus; 
    3736    NetworkStatus internetConnectionStatus; 
    3837} 
    3938 
    40 @property NetworkStatus remoteHostStatus; 
    4139@property NetworkStatus internetConnectionStatus; 
    4240 
  • apps/iphone/superbook/trunk/DotTel_SDK/Classes/NetworkUtility.m

    r884 r893  
    3333@implementation NetworkUtility 
    3434 
    35 @synthesize remoteHostStatus; 
    3635@synthesize internetConnectionStatus; 
    3736 
     
    7271        } 
    7372         
    74         [[Reachability sharedReachability] setAddress:@"208.67.222.222"]; 
    7573        [self updateStatus]; 
    7674        [[NSNotificationCenter defaultCenter] addObserver:self 
     
    7876                                                                                                 name:@"kNetworkReachabilityChangedNotification" 
    7977                                                                                           object:nil]; 
    80         return self.remoteHostStatus; 
     78        return self.internetConnectionStatus; 
    8179} 
    8280 
     
    8684 
    8785- (void)updateStatus { 
    88     self.remoteHostStatus = [[Reachability sharedReachability] remoteHostStatus]; 
    89     self.internetConnectionStatus = [[Reachability sharedReachability] internetConnectionStatus]; 
     86    self.internetConnectionStatus = [[Reachability reachabilityForInternetConnection] currentReachabilityStatus]; 
    9087        //NSLog(@"Reachability changed, values are: %d - %d", remoteHostStatus, internetConnectionStatus); 
    9188} 
  • apps/iphone/superbook/trunk/ShareKit

    • Property svn:ignore set to
      SHKConfig.h
  • apps/iphone/superbook/trunk/ShareKit/Core/Base Sharer Classes/SHKSharer.m

    r892 r893  
    128128                        return [self canShareFile]; 
    129129                        break; 
     130        default: 
     131            break; 
    130132        } 
    131133        return NO; 
     
    568570                        return (item.data != nil); 
    569571                        break; 
     572        default: 
     573            break; 
    570574        } 
    571575         
     
    656660                        [self share]; 
    657661                        break; 
     662        default: 
     663            break; 
    658664        } 
    659665} 
  • apps/iphone/superbook/trunk/ShareKit/Core/Helpers/SHKRequest.m

    r892 r893  
    3535@synthesize url, params, method, headerFields; 
    3636@synthesize delegate, isFinishedSelector; 
    37 @synthesize data, result, headers, response, connection; 
     37@synthesize data, headers, response, connection; 
    3838@synthesize success; 
     39@dynamic result; 
    3940 
    4041- (void)dealloc 
     
    146147} 
    147148 
    148  
     149- (void)setResult:(NSString *)_result 
     150{ 
     151    @synchronized(result) { 
     152        result = [[_result retain] autorelease]; 
     153    } 
     154} 
    149155@end 
  • apps/iphone/superbook/trunk/ShareKit/Core/SHK.m

    r892 r893  
    289289                                favoriteSharers = [NSArray arrayWithObjects:@"SHKMail", nil]; 
    290290                                break; 
     291            default: 
     292                break; 
    291293                } 
    292294                 
  • apps/iphone/superbook/trunk/ShareKit/Reachability/Reachability.h

    r892 r893  
    44 Abstract: Basic demonstration of how to use the SystemConfiguration Reachablity APIs. 
    55  
    6  Version: 2.1 
     6 Version: 2.2 
    77  
    88 Disclaimer: IMPORTANT:  This Apple software is supplied to you by Apple Inc. 
     
    4444 Copyright (C) 2010 Apple Inc. All Rights Reserved. 
    4545  
    46 */ 
     46 */ 
    4747 
    4848 
    4949#import <Foundation/Foundation.h> 
    5050#import <SystemConfiguration/SystemConfiguration.h> 
     51#import <netinet/in.h> 
    5152 
    5253typedef enum { 
    53         NotReachable = 0, 
    54         ReachableViaWiFi, 
    55         ReachableViaWWAN 
     54    NotReachable = 0, 
     55    ReachableViaWiFi, 
     56    ReachableViaWWAN 
    5657} NetworkStatus; 
    5758#define kReachabilityChangedNotification @"kNetworkReachabilityChangedNotification" 
     
    5960@interface Reachability: NSObject 
    6061{ 
    61         BOOL localWiFiRef; 
    62         SCNetworkReachabilityRef reachabilityRef; 
     62    BOOL localWiFiRef; 
     63    SCNetworkReachabilityRef reachabilityRef; 
    6364} 
    6465 
     
    8586- (BOOL) connectionRequired; 
    8687@end 
    87  
    88  
  • apps/iphone/superbook/trunk/ShareKit/Reachability/Reachability.m

    r892 r893  
    44 Abstract: Basic demonstration of how to use the SystemConfiguration Reachablity APIs. 
    55  
    6  Version: 2.1 
     6 Version: 2.2 
    77  
    88 Disclaimer: IMPORTANT:  This Apple software is supplied to you by Apple Inc. 
     
    4444 Copyright (C) 2010 Apple Inc. All Rights Reserved. 
    4545  
    46 */ 
     46 */ 
    4747 
    4848#import <sys/socket.h> 
     
    5757#import "Reachability.h" 
    5858 
    59 #define kShouldPrintReachabilityFlags 0 
     59#define kShouldPrintReachabilityFlags 1 
    6060 
    6161static void PrintReachabilityFlags(SCNetworkReachabilityFlags    flags, const char* comment) 
    6262{ 
    6363#if kShouldPrintReachabilityFlags 
    64          
     64     
    6565    NSLog(@"Reachability Flag Status: %c%c %c%c%c%c%c%c%c %s\n", 
    66                         (flags & kSCNetworkReachabilityFlagsIsWWAN)                               ? 'W' : '-', 
    67                         (flags & kSCNetworkReachabilityFlagsReachable)            ? 'R' : '-', 
    68                          
    69                         (flags & kSCNetworkReachabilityFlagsTransientConnection)  ? 't' : '-', 
    70                         (flags & kSCNetworkReachabilityFlagsConnectionRequired)   ? 'c' : '-', 
    71                         (flags & kSCNetworkReachabilityFlagsConnectionOnTraffic)  ? 'C' : '-', 
    72                         (flags & kSCNetworkReachabilityFlagsInterventionRequired) ? 'i' : '-', 
    73                         (flags & kSCNetworkReachabilityFlagsConnectionOnDemand)   ? 'D' : '-', 
    74                         (flags & kSCNetworkReachabilityFlagsIsLocalAddress)       ? 'l' : '-', 
    75                         (flags & kSCNetworkReachabilityFlagsIsDirect)             ? 'd' : '-', 
    76                         comment 
    77                         ); 
     66          (flags & kSCNetworkReachabilityFlagsIsWWAN)               ? 'W' : '-', 
     67          (flags & kSCNetworkReachabilityFlagsReachable)            ? 'R' : '-', 
     68           
     69          (flags & kSCNetworkReachabilityFlagsTransientConnection)  ? 't' : '-', 
     70          (flags & kSCNetworkReachabilityFlagsConnectionRequired)   ? 'c' : '-', 
     71          (flags & kSCNetworkReachabilityFlagsConnectionOnTraffic)  ? 'C' : '-', 
     72          (flags & kSCNetworkReachabilityFlagsInterventionRequired) ? 'i' : '-', 
     73          (flags & kSCNetworkReachabilityFlagsConnectionOnDemand)   ? 'D' : '-', 
     74          (flags & kSCNetworkReachabilityFlagsIsLocalAddress)       ? 'l' : '-', 
     75          (flags & kSCNetworkReachabilityFlagsIsDirect)             ? 'd' : '-', 
     76          comment 
     77          ); 
    7878#endif 
    7979} 
     
    8383static void ReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, void* info) 
    8484{ 
    85         #pragma unused (target, flags) 
    86         NSCAssert(info != NULL, @"info was NULL in ReachabilityCallback"); 
    87         NSCAssert([(NSObject*) info isKindOfClass: [Reachability class]], @"info was wrong class in ReachabilityCallback"); 
    88  
    89         //We're on the main RunLoop, so an NSAutoreleasePool is not necessary, but is added defensively 
    90         // in case someon uses the Reachablity object in a different thread. 
    91         NSAutoreleasePool* myPool = [[NSAutoreleasePool alloc] init]; 
    92          
    93         Reachability* noteObject = (Reachability*) info; 
    94         // Post a notification to notify the client that the network reachability changed. 
    95         [[NSNotificationCenter defaultCenter] postNotificationName: kReachabilityChangedNotification object: noteObject]; 
    96          
    97         [myPool release]; 
     85#pragma unused (target, flags) 
     86    NSCAssert(info != NULL, @"info was NULL in ReachabilityCallback"); 
     87    NSCAssert([(NSObject*) info isKindOfClass: [Reachability class]], @"info was wrong class in ReachabilityCallback"); 
     88     
     89    //We're on the main RunLoop, so an NSAutoreleasePool is not necessary, but is added defensively 
     90    // in case someon uses the Reachablity object in a different thread. 
     91    NSAutoreleasePool* myPool = [[NSAutoreleasePool alloc] init]; 
     92     
     93    Reachability* noteObject = (Reachability*) info; 
     94    // Post a notification to notify the client that the network reachability changed. 
     95    [[NSNotificationCenter defaultCenter] postNotificationName: kReachabilityChangedNotification object: noteObject]; 
     96     
     97    [myPool release]; 
    9898} 
    9999 
    100100- (BOOL) startNotifier 
    101101{ 
    102         BOOL retVal = NO; 
    103         SCNetworkReachabilityContext    context = {0, self, NULL, NULL, NULL}; 
    104         if(SCNetworkReachabilitySetCallback(reachabilityRef, ReachabilityCallback, &context)) 
    105         { 
    106                 if(SCNetworkReachabilityScheduleWithRunLoop(reachabilityRef, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode)) 
    107                 { 
    108                         retVal = YES; 
    109                 } 
    110         } 
    111         return retVal; 
     102    BOOL retVal = NO; 
     103    SCNetworkReachabilityContext    context = {0, self, NULL, NULL, NULL}; 
     104    if(SCNetworkReachabilitySetCallback(reachabilityRef, ReachabilityCallback, &context)) 
     105    { 
     106        if(SCNetworkReachabilityScheduleWithRunLoop(reachabilityRef, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode)) 
     107        { 
     108            retVal = YES; 
     109        } 
     110    } 
     111    return retVal; 
    112112} 
    113113 
    114114- (void) stopNotifier 
    115115{ 
    116         if(reachabilityRef!= NULL) 
    117         { 
    118                 SCNetworkReachabilityUnscheduleFromRunLoop(reachabilityRef, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode); 
    119         } 
     116    if(reachabilityRef!= NULL) 
     117    { 
     118        SCNetworkReachabilityUnscheduleFromRunLoop(reachabilityRef, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode); 
     119    } 
    120120} 
    121121 
    122122- (void) dealloc 
    123123{ 
    124         [self stopNotifier]; 
    125         if(reachabilityRef!= NULL) 
    126         { 
    127                 CFRelease(reachabilityRef); 
    128         } 
    129         [super dealloc]; 
     124    [self stopNotifier]; 
     125    if(reachabilityRef!= NULL) 
     126    { 
     127        CFRelease(reachabilityRef); 
     128    } 
     129    [super dealloc]; 
    130130} 
    131131 
    132132+ (Reachability*) reachabilityWithHostName: (NSString*) hostName; 
    133133{ 
    134         Reachability* retVal = NULL; 
    135         SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithName(NULL, [hostName UTF8String]); 
    136         if(reachability!= NULL) 
    137         { 
    138                 retVal= [[[self alloc] init] autorelease]; 
    139                 if(retVal!= NULL) 
    140                 { 
    141                         retVal->reachabilityRef = reachability; 
    142                         retVal->localWiFiRef = NO; 
    143                 } 
    144         } 
    145         return retVal; 
     134    Reachability* retVal = NULL; 
     135    SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithName(NULL, [hostName UTF8String]); 
     136    if(reachability!= NULL) 
     137    { 
     138        retVal= [[[self alloc] init] autorelease]; 
     139        if(retVal!= NULL) 
     140        { 
     141            retVal->reachabilityRef = reachability; 
     142            retVal->localWiFiRef = NO; 
     143        } 
     144    } 
     145    return retVal; 
    146146} 
    147147 
    148148+ (Reachability*) reachabilityWithAddress: (const struct sockaddr_in*) hostAddress; 
    149149{ 
    150         SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithAddress(kCFAllocatorDefault, (const struct sockaddr*)hostAddress); 
    151         Reachability* retVal = NULL; 
    152         if(reachability!= NULL) 
    153         { 
    154                 retVal= [[[self alloc] init] autorelease]; 
    155                 if(retVal!= NULL) 
    156                 { 
    157                         retVal->reachabilityRef = reachability; 
    158                         retVal->localWiFiRef = NO; 
    159                 } 
    160         } 
    161         return retVal; 
     150    SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithAddress(kCFAllocatorDefault, (const struct sockaddr*)hostAddress); 
     151    Reachability* retVal = NULL; 
     152    if(reachability!= NULL) 
     153    { 
     154        retVal= [[[self alloc] init] autorelease]; 
     155        if(retVal!= NULL) 
     156        { 
     157            retVal->reachabilityRef = reachability; 
     158            retVal->localWiFiRef = NO; 
     159        } 
     160    } 
     161    return retVal; 
    162162} 
    163163 
    164164+ (Reachability*) reachabilityForInternetConnection; 
    165165{ 
    166         struct sockaddr_in zeroAddress; 
    167         bzero(&zeroAddress, sizeof(zeroAddress)); 
    168         zeroAddress.sin_len = sizeof(zeroAddress); 
    169         zeroAddress.sin_family = AF_INET; 
    170         return [self reachabilityWithAddress: &zeroAddress]; 
     166    struct sockaddr_in zeroAddress; 
     167    bzero(&zeroAddress, sizeof(zeroAddress)); 
     168    zeroAddress.sin_len = sizeof(zeroAddress); 
     169    zeroAddress.sin_family = AF_INET; 
     170    return [self reachabilityWithAddress: &zeroAddress]; 
    171171} 
    172172 
    173173+ (Reachability*) reachabilityForLocalWiFi; 
    174174{ 
    175         struct sockaddr_in localWifiAddress; 
    176         bzero(&localWifiAddress, sizeof(localWifiAddress)); 
    177         localWifiAddress.sin_len = sizeof(localWifiAddress); 
    178         localWifiAddress.sin_family = AF_INET; 
    179         // IN_LINKLOCALNETNUM is defined in <netinet/in.h> as 169.254.0.0 
    180         localWifiAddress.sin_addr.s_addr = htonl(IN_LINKLOCALNETNUM); 
    181         Reachability* retVal = [self reachabilityWithAddress: &localWifiAddress]; 
    182         if(retVal!= NULL) 
    183         { 
    184                 retVal->localWiFiRef = YES; 
    185         } 
    186         return retVal; 
     175    struct sockaddr_in localWifiAddress; 
     176    bzero(&localWifiAddress, sizeof(localWifiAddress)); 
     177    localWifiAddress.sin_len = sizeof(localWifiAddress); 
     178    localWifiAddress.sin_family = AF_INET; 
     179    // IN_LINKLOCALNETNUM is defined in <netinet/in.h> as 169.254.0.0 
     180    localWifiAddress.sin_addr.s_addr = htonl(IN_LINKLOCALNETNUM); 
     181    Reachability* retVal = [self reachabilityWithAddress: &localWifiAddress]; 
     182    if(retVal!= NULL) 
     183    { 
     184        retVal->localWiFiRef = YES; 
     185    } 
     186    return retVal; 
    187187} 
    188188 
     
    191191- (NetworkStatus) localWiFiStatusForFlags: (SCNetworkReachabilityFlags) flags 
    192192{ 
    193         PrintReachabilityFlags(flags, "localWiFiStatusForFlags"); 
    194  
    195         BOOL retVal = NotReachable; 
    196         if((flags & kSCNetworkReachabilityFlagsReachable) && (flags & kSCNetworkReachabilityFlagsIsDirect)) 
    197         { 
    198                 retVal = ReachableViaWiFi;       
    199         } 
    200         return retVal; 
     193    PrintReachabilityFlags(flags, "localWiFiStatusForFlags"); 
     194     
     195    BOOL retVal = NotReachable; 
     196    if((flags & kSCNetworkReachabilityFlagsReachable) && (flags & kSCNetworkReachabilityFlagsIsDirect)) 
     197    { 
     198        retVal = ReachableViaWiFi;   
     199    } 
     200    return retVal; 
    201201} 
    202202 
    203203- (NetworkStatus) networkStatusForFlags: (SCNetworkReachabilityFlags) flags 
    204204{ 
    205         PrintReachabilityFlags(flags, "networkStatusForFlags"); 
    206         if ((flags & kSCNetworkReachabilityFlagsReachable) == 0) 
    207         { 
    208                 // if target host is not reachable 
    209                 return NotReachable; 
    210         } 
    211  
    212         BOOL retVal = NotReachable; 
    213          
    214         if ((flags & kSCNetworkReachabilityFlagsConnectionRequired) == 0) 
    215         { 
    216                 // if target host is reachable and no connection is required 
    217                 //  then we'll assume (for now) that your on Wi-Fi 
    218                 retVal = ReachableViaWiFi; 
    219         } 
    220          
    221          
    222         if ((((flags & kSCNetworkReachabilityFlagsConnectionOnDemand ) != 0) || 
    223                 (flags & kSCNetworkReachabilityFlagsConnectionOnTraffic) != 0)) 
    224         { 
    225                         // ... and the connection is on-demand (or on-traffic) if the 
    226                         //     calling application is using the CFSocketStream or higher APIs 
    227  
    228                         if ((flags & kSCNetworkReachabilityFlagsInterventionRequired) == 0) 
    229                         { 
    230                                 // ... and no [user] intervention is needed 
    231                                 retVal = ReachableViaWiFi; 
    232                         } 
    233                 } 
    234          
    235         if ((flags & kSCNetworkReachabilityFlagsIsWWAN) == kSCNetworkReachabilityFlagsIsWWAN) 
    236         { 
    237                 // ... but WWAN connections are OK if the calling application 
    238                 //     is using the CFNetwork (CFSocketStream?) APIs. 
    239                 retVal = ReachableViaWWAN; 
    240         } 
    241         return retVal; 
     205    PrintReachabilityFlags(flags, "networkStatusForFlags"); 
     206    if ((flags & kSCNetworkReachabilityFlagsReachable) == 0) 
     207    { 
     208        // if target host is not reachable 
     209        return NotReachable; 
     210    } 
     211     
     212    BOOL retVal = NotReachable; 
     213     
     214    if ((flags & kSCNetworkReachabilityFlagsConnectionRequired) == 0) 
     215    { 
     216        // if target host is reachable and no connection is required 
     217        //  then we'll assume (for now) that your on Wi-Fi 
     218        retVal = ReachableViaWiFi; 
     219    } 
     220     
     221     
     222    if ((((flags & kSCNetworkReachabilityFlagsConnectionOnDemand ) != 0) || 
     223         (flags & kSCNetworkReachabilityFlagsConnectionOnTraffic) != 0)) 
     224    { 
     225        // ... and the connection is on-demand (or on-traffic) if the 
     226        //     calling application is using the CFSocketStream or higher APIs 
     227         
     228        if ((flags & kSCNetworkReachabilityFlagsInterventionRequired) == 0) 
     229        { 
     230            // ... and no [user] intervention is needed 
     231            retVal = ReachableViaWiFi; 
     232        } 
     233    } 
     234     
     235    if ((flags & kSCNetworkReachabilityFlagsIsWWAN) == kSCNetworkReachabilityFlagsIsWWAN) 
     236    { 
     237        // ... but WWAN connections are OK if the calling application 
     238        //     is using the CFNetwork (CFSocketStream?) APIs. 
     239        retVal = ReachableViaWWAN; 
     240    } 
     241    return retVal; 
    242242} 
    243243 
    244244- (BOOL) connectionRequired; 
    245245{ 
    246         NSAssert(reachabilityRef != NULL, @"connectionRequired called with NULL reachabilityRef"); 
    247         SCNetworkReachabilityFlags flags; 
    248         if (SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) 
    249         { 
    250                 return (flags & kSCNetworkReachabilityFlagsConnectionRequired); 
    251         } 
    252         return NO; 
     246    NSAssert(reachabilityRef != NULL, @"connectionRequired called with NULL reachabilityRef"); 
     247    SCNetworkReachabilityFlags flags; 
     248    if (SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) 
     249    { 
     250        return (flags & kSCNetworkReachabilityFlagsConnectionRequired); 
     251    } 
     252    return NO; 
    253253} 
    254254 
    255255- (NetworkStatus) currentReachabilityStatus 
    256256{ 
    257         NSAssert(reachabilityRef != NULL, @"currentNetworkStatus called with NULL reachabilityRef"); 
    258         NetworkStatus retVal = NotReachable; 
    259         SCNetworkReachabilityFlags flags; 
    260         if (SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) 
    261         { 
    262                 if(localWiFiRef) 
    263                 { 
    264                         retVal = [self localWiFiStatusForFlags: flags]; 
    265                 } 
    266                 else 
    267                 { 
    268                         retVal = [self networkStatusForFlags: flags]; 
    269                 } 
    270         } 
    271         return retVal; 
     257    NSAssert(reachabilityRef != NULL, @"currentNetworkStatus called with NULL reachabilityRef"); 
     258    NetworkStatus retVal = NotReachable; 
     259    SCNetworkReachabilityFlags flags; 
     260    if (SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) 
     261    { 
     262        if(localWiFiRef) 
     263        { 
     264            retVal = [self localWiFiStatusForFlags: flags]; 
     265        } 
     266        else 
     267        { 
     268            retVal = [self networkStatusForFlags: flags]; 
     269        } 
     270    } 
     271    return retVal; 
    272272} 
    273273@end 
  • apps/iphone/superbook/trunk/ShareKit/Sharers/Services/Facebook/FBConnect/FBDialog.m

    r892 r893  
    167167  CGFloat height = floor(scale_factor * frame.size.height) - kPadding * 2; 
    168168 
    169   _orientation = [UIApplication sharedApplication].statusBarOrientation; 
     169    _orientation = [UIDevice currentDevice].orientation; 
    170170  if (UIInterfaceOrientationIsLandscape(_orientation)) { 
    171171    self.frame = CGRectMake(kPadding, kPadding, height, width); 
     
    329329                _closeButton.titleLabel.font = [UIFont boldSystemFontOfSize:12]; 
    330330        } else { // This triggers a deprecation warning but at least it will work on OS 2.x 
    331                 _closeButton.font = [UIFont boldSystemFontOfSize:12]; 
     331                _closeButton.titleLabel.font = [UIFont boldSystemFontOfSize:12]; 
    332332        } 
    333333        _closeButton.showsTouchWhenHighlighted = YES; 
     
    440440 
    441441- (void)deviceOrientationDidChange:(void*)object { 
    442   UIDeviceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation; 
     442  UIDeviceOrientation orientation = [UIDevice currentDevice].orientation; 
    443443  if (!_showingKeyboard && [self shouldRotateToOrientation:orientation]) { 
    444444    [self updateWebOrientation]; 
  • apps/iphone/superbook/trunk/ShareKit/Sharers/Services/Facebook/FBConnect/FBRequest.m

    r892 r893  
    171171  } 
    172172   
    173   FBLOG2(@"Sending %s", [body bytes]); 
    174173  return body; 
    175174} 
     
    209208 
    210209- (void)handleResponseData:(NSData*)data { 
    211   FBLOG2(@"DATA: %s", data.bytes); 
    212210  NSError* error = nil; 
    213211  id result = [self parseXMLResponse:data error:&error]; 
     
    220218 
    221219- (void)connect { 
    222   FBLOG(@"Connecting to %@ %@", _url, _params); 
    223220 
    224221  if ([_delegate respondsToSelector:@selector(requestLoading:)]) { 
  • apps/iphone/superbook/trunk/ShareKit/Sharers/Services/Facebook/FBConnect/FBXMLHandler.h

    r892 r893  
    1717#import "FBConnectGlobal.h" 
    1818 
    19 @interface FBXMLHandler : NSObject { 
     19@interface FBXMLHandler : NSObject <NSXMLParserDelegate> { 
    2020  NSMutableArray* _stack; 
    2121  NSMutableArray* _nameStack; 
  • apps/iphone/superbook/trunk/ShareKit/Sharers/Services/Facebook/SHKFacebook.m

    r892 r893  
    125125                fbSession = [FBSession sessionForApplication:SHKFacebookKey 
    126126                                                                                                 secret:SHKFacebookSecret 
    127                                                                                            delegate:self]; 
     127                                                                                           delegate:nil]; 
     128        [fbSession.delegates addObject:self]; 
    128129                 
    129130        }else { 
    130131                fbSession = [FBSession sessionForApplication:SHKFacebookKey 
    131132                                                                                getSessionProxy:SHKFacebookSessionProxyURL 
    132                                                                                            delegate:self]; 
     133                                                                                           delegate:nil]; 
     134        [fbSession.delegates addObject:self]; 
    133135        } 
    134136 
  • apps/iphone/superbook/trunk/ShareKit/Sharers/Services/Twitter/SHKTwitterForm.m

    r892 r893  
    113113        CGFloat keyboardHeight; 
    114114         
    115         // 3.2 and above 
    116         /*if (UIKeyboardFrameEndUserInfoKey) 
    117          {               
    118          [[notification.userInfo valueForKey:UIKeyboardFrameEndUserInfoKey] getValue:&keyboardFrame];            
    119          if ([[UIDevice currentDevice] orientation] == UIDeviceOrientationPortrait || [[UIDevice currentDevice] orientation] == UIDeviceOrientationPortraitUpsideDown)  
    120          keyboardHeight = keyboardFrame.size.height; 
    121          else 
    122          keyboardHeight = keyboardFrame.size.width; 
    123          } 
    124           
    125          // < 3.2 
    126          else  
    127          {*/ 
    128         [[notification.userInfo valueForKey:UIKeyboardBoundsUserInfoKey] getValue:&keyboardFrame]; 
    129         keyboardHeight = keyboardFrame.size.height; 
    130         //} 
     115        if (UIKeyboardFrameEndUserInfoKey) 
     116    {            
     117        [[notification.userInfo valueForKey:UIKeyboardFrameEndUserInfoKey] getValue:&keyboardFrame];             
     118        if ([[UIDevice currentDevice] orientation] == UIDeviceOrientationPortrait || [[UIDevice currentDevice] orientation] == UIDeviceOrientationPortraitUpsideDown)  
     119            keyboardHeight = keyboardFrame.size.height; 
     120        else 
     121            keyboardHeight = keyboardFrame.size.width; 
     122    } 
    131123         
    132124        // Find the bottom of the screen (accounting for keyboard overlay) 
  • apps/iphone/superbook/trunk/ShareKit/Sharers/Services/Twitter/SHKTwitter.m

    r892 r893  
    290290{ 
    291291        NSString *status = [item customValueForKey:@"status"]; 
    292         return status != nil && status.length >= 0 && status.length <= 140; 
     292        return status != nil && status.length <= 140; 
    293293} 
    294294 
  • apps/iphone/superbook/trunk/ShareKit/SHKConfig.h

    r892 r893  
    1515// These values are used by any service that shows 'shared from XYZ' 
    1616 
    17 #define SHKMyAppName                    @".telpages" 
     17#define SHKMyAppName                    @".tel Superbook" 
    1818#define SHKMyAppURL                             @"http://superbook.tel" 
    1919 
     
    4040 
    4141// Delicious - https://developer.apps.yahoo.com/projects 
    42 #define SHKDeliciousConsumerKey         @"" 
    43 #define SHKDeliciousSecretKey           @"" 
     42#define SHKDeliciousConsumerKey         @"dj0yJmk9MTRGOEJSajBJeTVxJmQ9WVdrOVIxbzFPRFJ5TldrbWNHbzlNVGczT1RBNU9UTTJNZy0tJnM9Y29uc3VtZXJzZWNyZXQmeD1kOQ--" 
     43#define SHKDeliciousSecretKey           @"be654a8b9cb2e924f6e0f41d4b1a7adf26556659" 
    4444 
    4545// Facebook - http://www.facebook.com/developers 
     
    4747 
    4848#define SHKFacebookUseSessionProxy  NO  
    49 #define SHKFacebookKey                          @"" 
    50 #define SHKFacebookSecret                       @"" 
     49#define SHKFacebookKey                          @"229935623724063" 
     50#define SHKFacebookSecret                       @"f85078fbd65b42735a3830ec4ce4ecf0" 
    5151#define SHKFacebookSessionProxyURL  @"" 
    5252 
     
    116116#define SHKShareMenuAlphabeticalOrder 1 // Setting this to 1 will show list in Alphabetical Order, setting to 0 will follow the order in SHKShares.plist 
    117117 
    118 // Append 'Shared With 'Signature to Email (and related forms) 
    119 #define SHKSharedWithSignature          0 
    120  
    121118/* 
    122119 UI Configuration : Advanced 
  • apps/iphone/superbook/trunk/ShareKit/UI/SHKActionSheet.m

    r892 r893  
    4646{ 
    4747        SHKActionSheet *as = [[SHKActionSheet alloc] initWithTitle:SHKLocalizedString(@"Share") 
    48                                                                                                           delegate:self 
     48                                                                                                          delegate:nil 
    4949                                                                                         cancelButtonTitle:nil 
    5050                                                                                destructiveButtonTitle:nil 
     
    5252        as.item = [[[SHKItem alloc] init] autorelease]; 
    5353        as.item.shareType = type; 
    54          
     54        as.delegate = as; 
     55     
    5556        as.sharers = [NSMutableArray arrayWithCapacity:0]; 
    5657        NSArray *favoriteSharers = [SHK favoriteSharersForType:type]; 
  • apps/iphone/superbook/trunk/ShareKit/UI/SHKFormFieldCell.m

    r892 r893  
    3131@implementation SHKFormFieldCell 
    3232 
    33 @synthesize settings; 
     33@dynamic settings; 
    3434@synthesize labelWidth; 
    3535@synthesize textField, toggle, tmpValue; 
     
    125125- (void)setSettings:(SHKFormFieldSettings *)s 
    126126{ 
    127         [settings release]; 
    128         settings = [s retain]; 
    129         [self setNeedsLayout];   
     127    @synchronized(settings) { 
     128        [settings release]; 
     129        settings = [s retain]; 
     130        [self setNeedsLayout]; 
     131    } 
     132} 
     133 
     134-(SHKFormFieldSettings *)settings { 
     135    return settings; 
    130136} 
    131137 
     
    154160                        return toggle.on ? SHKFormFieldSwitchOn : SHKFormFieldSwitchOff; 
    155161                        break; 
     162        default: 
     163            break; 
    156164        } 
    157165         
  • apps/iphone/superbook/trunk/ShareKit/UI/SHKShareMenu.m

    r892 r893  
    3333@implementation SHKShareMenu 
    3434 
    35 @synthesize item; 
     35@dynamic item; 
    3636@synthesize tableData; 
    3737@synthesize exclusions; 
     
    7676} 
    7777 
     78- (SHKItem *)item { 
     79    return item; 
     80} 
    7881 
    7982- (void)setItem:(SHKItem *)i 
    8083{ 
    81         [item release]; 
    82         item = [i retain]; 
    83          
    84         [self rebuildTableDataAnimated:NO]; 
     84    @synchronized(item) { 
     85        [item release]; 
     86        item = [[i retain] autorelease]; 
     87        [self rebuildTableDataAnimated:NO]; 
     88    } 
    8589} 
    8690 
  • apps/iphone/superbook/trunk/Superbook.xcodeproj/project.pbxproj

    r892 r893  
    162162                38AE309014151A5D0004CE2F /* SHKShareMenu.m in Sources */ = {isa = PBXBuildFile; fileRef = 38AE305014151A5D0004CE2F /* SHKShareMenu.m */; }; 
    163163                38AE309114151A5D0004CE2F /* SHKViewControllerWrapper.m in Sources */ = {isa = PBXBuildFile; fileRef = 38AE305214151A5D0004CE2F /* SHKViewControllerWrapper.m */; }; 
     164                38AE30931415FD800004CE2F /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 38AE30921415FD800004CE2F /* MessageUI.framework */; }; 
     165                38AE30951415FD8B0004CE2F /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 38AE30941415FD8B0004CE2F /* Security.framework */; }; 
    164166                38B0BB2413E88F54006551A0 /* TPRelevanceView.m in Sources */ = {isa = PBXBuildFile; fileRef = 38B0BB2313E88F54006551A0 /* TPRelevanceView.m */; }; 
    165167                38B0BB3413EAB6CE006551A0 /* Icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = 38B0BB2E13EAB6CE006551A0 /* Icon-72.png */; }; 
     
    194196                38D160E90F85662400A97E88 /* resolv.conf in Resources */ = {isa = PBXBuildFile; fileRef = 38D160E80F85662400A97E88 /* resolv.conf */; }; 
    195197                38D163260F861E2E00A97E88 /* NetworkUtility.m in Sources */ = {isa = PBXBuildFile; fileRef = 38D163250F861E2E00A97E88 /* NetworkUtility.m */; }; 
    196                 38D164CD0F864A1000A97E88 /* Reachability.m in Sources */ = {isa = PBXBuildFile; fileRef = 38D164CC0F864A1000A97E88 /* Reachability.m */; }; 
    197198                38D8DDF41151415100FD0DEF /* TelDomain.m in Sources */ = {isa = PBXBuildFile; fileRef = 38D8DDF31151415100FD0DEF /* TelDomain.m */; }; 
    198199                38DB6B4F0F8B943500C7AE69 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 38DB6B4E0F8B943500C7AE69 /* Icon.png */; }; 
     
    483484                38AE305114151A5D0004CE2F /* SHKViewControllerWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SHKViewControllerWrapper.h; sourceTree = "<group>"; }; 
    484485                38AE305214151A5D0004CE2F /* SHKViewControllerWrapper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SHKViewControllerWrapper.m; sourceTree = "<group>"; }; 
     486                38AE30921415FD800004CE2F /* MessageUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MessageUI.framework; path = System/Library/Frameworks/MessageUI.framework; sourceTree = SDKROOT; }; 
     487                38AE30941415FD8B0004CE2F /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; }; 
    485488                38B0BB2213E88F54006551A0 /* TPRelevanceView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TPRelevanceView.h; sourceTree = "<group>"; }; 
    486489                38B0BB2313E88F54006551A0 /* TPRelevanceView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TPRelevanceView.m; sourceTree = "<group>"; }; 
     
    522525                38D163240F861E2E00A97E88 /* NetworkUtility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetworkUtility.h; sourceTree = "<group>"; }; 
    523526                38D163250F861E2E00A97E88 /* NetworkUtility.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NetworkUtility.m; sourceTree = "<group>"; }; 
    524                 38D164CB0F864A1000A97E88 /* Reachability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Reachability.h; sourceTree = "<group>"; }; 
    525                 38D164CC0F864A1000A97E88 /* Reachability.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Reachability.m; sourceTree = "<group>"; }; 
    526527                38D8DDF21151415100FD0DEF /* TelDomain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TelDomain.h; sourceTree = "<group>"; }; 
    527528                38D8DDF31151415100FD0DEF /* TelDomain.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TelDomain.m; sourceTree = "<group>"; }; 
     
    580581                                38A54FE513E1A2360070351B /* libiconv.dylib in Frameworks */, 
    581582                                38A54FE713E1A24A0070351B /* libxml2.dylib in Frameworks */, 
     583                                38AE30931415FD800004CE2F /* MessageUI.framework in Frameworks */, 
     584                                38AE30951415FD8B0004CE2F /* Security.framework in Frameworks */, 
    582585                        ); 
    583586                        runOnlyForDeploymentPostprocessing = 0; 
     
    673676                        isa = PBXGroup; 
    674677                        children = ( 
     678                                38AE30941415FD8B0004CE2F /* Security.framework */, 
     679                                38AE30921415FD800004CE2F /* MessageUI.framework */, 
    675680                                38A54FE813E1A2650070351B /* CoreText.framework */, 
    676681                                38A54FE613E1A24A0070351B /* libxml2.dylib */, 
     
    805810                                38D163240F861E2E00A97E88 /* NetworkUtility.h */, 
    806811                                38D163250F861E2E00A97E88 /* NetworkUtility.m */, 
    807                                 38D164CB0F864A1000A97E88 /* Reachability.h */, 
    808                                 38D164CC0F864A1000A97E88 /* Reachability.m */, 
    809812                                385BD6C80EBF694500D32EB0 /* RecordLoc.h */, 
    810813                                385BD6C90EBF694500D32EB0 /* RecordLoc.m */, 
     
    15091512                                382F8C1C0F8379CB00ED53BF /* NSString+UITableViewHelper.m in Sources */, 
    15101513                                38D163260F861E2E00A97E88 /* NetworkUtility.m in Sources */, 
    1511                                 38D164CD0F864A1000A97E88 /* Reachability.m in Sources */, 
    15121514                                387680950FC9B3CD00360BD4 /* DotTelABDelegate.m in Sources */, 
    15131515                                3876822F0FCD483E00360BD4 /* DotTelABMapper.m in Sources */, 
     
    17021704                        isa = XCBuildConfiguration; 
    17031705                        buildSettings = { 
    1704                                 ARCHS = ( 
    1705                                         armv6, 
    1706                                         armv7, 
    1707                                 ); 
     1706                                ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 
    17081707                                CODE_SIGN_ENTITLEMENTS = Entitlements.plist; 
    17091708                                CODE_SIGN_IDENTITY = "iPhone Distribution: Henri Asseily"; 
     
    17481747                        isa = XCBuildConfiguration; 
    17491748                        buildSettings = { 
    1750                                 ARCHS = ( 
    1751                                         armv6, 
    1752                                         armv7, 
    1753                                 ); 
     1749                                ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 
    17541750                                CODE_SIGN_IDENTITY = "iPhone Distribution"; 
    17551751                                GCC_C_LANGUAGE_STANDARD = c99; 
     
    17931789                        isa = XCBuildConfiguration; 
    17941790                        buildSettings = { 
    1795                                 ARCHS = ( 
    1796                                         armv6, 
    1797                                         armv7, 
    1798                                 ); 
     1791                                ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 
    17991792                                CODE_SIGN_IDENTITY = "iPhone Developer"; 
    18001793                                GCC_C_LANGUAGE_STANDARD = c99; 
     
    18161809                        isa = XCBuildConfiguration; 
    18171810                        buildSettings = { 
    1818                                 ARCHS = ( 
    1819                                         armv6, 
    1820                                         armv7, 
    1821                                 ); 
     1811                                ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 
    18221812                                CODE_SIGN_IDENTITY = "iPhone Developer"; 
    18231813                                GCC_C_LANGUAGE_STANDARD = c99; 
Telnic
Search This Site
Partners
Neustar
ICANN
Main site | WHOIS | Sell .tel | FAQ | Archived Site | About Telnic | Contact Us