Permalink
Browse files

Changed 3 __bridge casts to __bridge_transfer. Added "’s" to stringsT…

…oStrip.
  • Loading branch information...
1 parent b521dd2 commit 00ccbf901c84c4d48af8d7b9dded21d1d23e521c @jeethu jeethu committed May 23, 2012
Showing with 5 additions and 4 deletions.
  1. +5 −4 JBDeviceOwner/JBDeviceOwner.m
View
9 JBDeviceOwner/JBDeviceOwner.m
@@ -44,7 +44,8 @@ - (id)initWithDevice:(UIDevice *)aDevice {
self.device = aDevice;
NSMutableString *deviceName = [NSMutableString stringWithString:self.device.name];
- NSArray *stringsToStrip = [NSArray arrayWithObjects:@"'s",
+ NSArray *stringsToStrip = [NSArray arrayWithObjects:@"’s",
+ @"'s",
@"ipad",
@"iphone",
@"ipod touch", nil];
@@ -79,15 +80,15 @@ - (id)initWithDevice:(UIDevice *)aDevice {
- (void)populateFromAddressBook {
ABAddressBookRef addressBook = ABAddressBookCreate();
- NSArray *people = (__bridge NSArray *)ABAddressBookCopyPeopleWithName(addressBook, (__bridge CFStringRef)self.fullName);
+ NSArray *people = (__bridge_transfer NSArray *)ABAddressBookCopyPeopleWithName(addressBook, (__bridge CFStringRef)self.fullName);
self.hasAddressBookMatch = ([people count] > 0);
if (self.hasAddressBookMatch) {
ABRecordRef owner = (__bridge ABRecordRef)[people objectAtIndex:0];
// Email
ABMultiValueRef emailMultiValue = ABRecordCopyValue(owner, kABPersonEmailProperty);
- NSArray *emails = (__bridge NSArray *)ABMultiValueCopyArrayOfAllValues(emailMultiValue);
+ NSArray *emails = (__bridge_transfer NSArray *)ABMultiValueCopyArrayOfAllValues(emailMultiValue);
if ([emails count] > 0) {
self.email = (NSString *)[emails objectAtIndex:0];
@@ -97,7 +98,7 @@ - (void)populateFromAddressBook {
// Phone
ABMultiValueRef phoneMultiValue = ABRecordCopyValue(owner, kABPersonPhoneProperty);
- NSArray *phones = (__bridge NSArray *)ABMultiValueCopyArrayOfAllValues(phoneMultiValue);
+ NSArray *phones = (__bridge_transfer NSArray *)ABMultiValueCopyArrayOfAllValues(phoneMultiValue);
if ([phones count] > 0) {
self.phone = (NSString *)[phones objectAtIndex:0];

0 comments on commit 00ccbf9

Please sign in to comment.