Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Changed 3 __bridge casts to __bridge_transfer. Added "’s" to stringsToStrip. #7

Merged
merged 1 commit into from

2 participants

Jeethu Rao Jake Boxer
Jeethu Rao

Hi Jake,
Here's a minor patch with 4 superficial changes.

XCode's analyzer was complaining about 2 __bridge casts in the populateFromAddressBook method in JBDeviceOwner.m. Changed them to __bridge_transfer, so that their ownership is transferred to ARC.

Also, stringsToStrip in initWithDevice: in the same file had a "'s" but was missing a "’s" (difference: apostrophe-s and right-single-quote-s), which is quite a common case, added it.

Jake Boxer
Owner

Hey man, really sorry for taking so long to get to this. Thanks a bunch for the contribution!

Jake Boxer jakeboxer merged commit 29cb38b into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 4 deletions.
  1. +5 −4 JBDeviceOwner/JBDeviceOwner.m
9 JBDeviceOwner/JBDeviceOwner.m
View
@@ -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,7 +80,7 @@ - (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) {
@@ -87,7 +88,7 @@ - (void)populateFromAddressBook {
// 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];
Something went wrong with that request. Please try again.