diff --git a/Classes/AboutViewController.h b/Classes/AboutViewController.h index 041031e06..033177e26 100644 --- a/Classes/AboutViewController.h +++ b/Classes/AboutViewController.h @@ -24,15 +24,15 @@ @interface AboutViewController : UIViewController { } -@property (nonatomic, retain) IBOutlet UILabel *linphoneLabel; -@property (nonatomic, retain) IBOutlet UILabel *linphoneIphoneVersionLabel; -@property (nonatomic, retain) IBOutlet UILabel *linphoneCoreVersionLabel; -@property (nonatomic, retain) IBOutlet UIView *contentView; -@property (nonatomic, retain) IBOutlet UILabel *linkLabel; -@property (nonatomic, retain) IBOutlet UILabel *copyrightLabel; -@property (nonatomic, retain) IBOutlet UILabel *licenseLabel; -@property (nonatomic, retain) IBOutlet UIWebView *licensesView; -@property (nonatomic, retain) IBOutlet UITapGestureRecognizer *linkTapGestureRecognizer; +@property (nonatomic, strong) IBOutlet UILabel *linphoneLabel; +@property (nonatomic, strong) IBOutlet UILabel *linphoneIphoneVersionLabel; +@property (nonatomic, strong) IBOutlet UILabel *linphoneCoreVersionLabel; +@property (nonatomic, strong) IBOutlet UIView *contentView; +@property (nonatomic, strong) IBOutlet UILabel *linkLabel; +@property (nonatomic, strong) IBOutlet UILabel *copyrightLabel; +@property (nonatomic, strong) IBOutlet UILabel *licenseLabel; +@property (nonatomic, strong) IBOutlet UIWebView *licensesView; +@property (nonatomic, strong) IBOutlet UITapGestureRecognizer *linkTapGestureRecognizer; - (IBAction)onLinkTap:(id)sender; diff --git a/Classes/AboutViewController.m b/Classes/AboutViewController.m index d969ae16f..0c50ea240 100644 --- a/Classes/AboutViewController.m +++ b/Classes/AboutViewController.m @@ -45,16 +45,6 @@ return self; } -- (void)dealloc { - [linphoneCoreVersionLabel release]; - [linphoneIphoneVersionLabel release]; - [contentView release]; - [linkTapGestureRecognizer release]; - [linkLabel release]; - [licensesView release]; - - [super dealloc]; -} #pragma mark - ViewController Functions diff --git a/Classes/ChatRoomTableViewController.h b/Classes/ChatRoomTableViewController.h index 38fc39114..192ac77d6 100644 --- a/Classes/ChatRoomTableViewController.h +++ b/Classes/ChatRoomTableViewController.h @@ -35,7 +35,7 @@ MSList *messageList; } -@property (nonatomic, retain) id chatRoomDelegate; +@property (nonatomic, strong) id chatRoomDelegate; - (void)addChatEntry:(LinphoneChatMessage*)chat; - (void)scrollToBottom:(BOOL)animated; diff --git a/Classes/ChatRoomTableViewController.m b/Classes/ChatRoomTableViewController.m index 0eba8c776..88b4d24f9 100644 --- a/Classes/ChatRoomTableViewController.m +++ b/Classes/ChatRoomTableViewController.m @@ -32,10 +32,8 @@ #pragma mark - Lifecycle Functions - (void)dealloc { - [chatRoomDelegate release]; [self clearMessageList]; - [super dealloc]; } #pragma mark - ViewController Functions @@ -168,7 +166,7 @@ static NSString *kCellId = @"UIChatRoomCell"; UIChatRoomCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellId]; if (cell == nil) { - cell = [[[UIChatRoomCell alloc] initWithIdentifier:kCellId] autorelease]; + cell = [[UIChatRoomCell alloc] initWithIdentifier:kCellId]; } LinphoneChatMessage* chat = ms_list_nth_data(self->messageList, (int)[indexPath row]); diff --git a/Classes/ChatRoomViewController.h b/Classes/ChatRoomViewController.h index 6748d383f..f543f1868 100644 --- a/Classes/ChatRoomViewController.h +++ b/Classes/ChatRoomViewController.h @@ -37,27 +37,27 @@ BOOL composingVisible; } -@property (nonatomic, retain) IBOutlet ChatRoomTableViewController* tableController; -@property (nonatomic, retain) IBOutlet UIToggleButton *editButton; -@property (nonatomic, retain) IBOutlet HPGrowingTextView* messageField; -@property (nonatomic, retain) IBOutlet UIButton* sendButton; -@property (nonatomic, retain) IBOutlet UILabel *addressLabel; -@property (nonatomic, retain) IBOutlet UIImageView *avatarImage; -@property (nonatomic, retain) IBOutlet UIView *headerView; -@property (nonatomic, retain) IBOutlet UIView *chatView; -@property (nonatomic, retain) IBOutlet UIView *messageView; -@property (nonatomic, retain) IBOutlet UIImageView *messageBackgroundImage; -@property (nonatomic, retain) IBOutlet UIImageView *transferBackgroundImage; -@property (nonatomic, retain) IBOutlet UITapGestureRecognizer *listTapGestureRecognizer; -@property (nonatomic, retain) IBOutlet UISwipeGestureRecognizer *listSwipeGestureRecognizer; -@property (retain, nonatomic) IBOutlet UILabel *composeLabel; -@property (retain, nonatomic) IBOutlet UIView *composeIndicatorView; +@property (nonatomic, strong) IBOutlet ChatRoomTableViewController* tableController; +@property (nonatomic, strong) IBOutlet UIToggleButton *editButton; +@property (nonatomic, strong) IBOutlet HPGrowingTextView* messageField; +@property (nonatomic, strong) IBOutlet UIButton* sendButton; +@property (nonatomic, strong) IBOutlet UILabel *addressLabel; +@property (nonatomic, strong) IBOutlet UIImageView *avatarImage; +@property (nonatomic, strong) IBOutlet UIView *headerView; +@property (nonatomic, strong) IBOutlet UIView *chatView; +@property (nonatomic, strong) IBOutlet UIView *messageView; +@property (nonatomic, strong) IBOutlet UIImageView *messageBackgroundImage; +@property (nonatomic, strong) IBOutlet UIImageView *transferBackgroundImage; +@property (nonatomic, strong) IBOutlet UITapGestureRecognizer *listTapGestureRecognizer; +@property (nonatomic, strong) IBOutlet UISwipeGestureRecognizer *listSwipeGestureRecognizer; +@property (strong, nonatomic) IBOutlet UILabel *composeLabel; +@property (strong, nonatomic) IBOutlet UIView *composeIndicatorView; -@property (nonatomic, retain) IBOutlet UIButton* pictureButton; -@property (nonatomic, retain) IBOutlet UIButton* cancelTransferButton; -@property (nonatomic, retain) IBOutlet UIProgressView* imageTransferProgressBar; -@property (nonatomic, retain) IBOutlet UIView* transferView; -@property (nonatomic, retain) IBOutlet UIView* waitView; +@property (nonatomic, strong) IBOutlet UIButton* pictureButton; +@property (nonatomic, strong) IBOutlet UIButton* cancelTransferButton; +@property (nonatomic, strong) IBOutlet UIProgressView* imageTransferProgressBar; +@property (nonatomic, strong) IBOutlet UIView* transferView; +@property (nonatomic, strong) IBOutlet UIView* waitView; - (IBAction)onBackClick:(id)event; - (IBAction)onEditClick:(id)event; diff --git a/Classes/ChatRoomViewController.m b/Classes/ChatRoomViewController.m index bb999d7b4..53caf7475 100644 --- a/Classes/ChatRoomViewController.m +++ b/Classes/ChatRoomViewController.m @@ -70,31 +70,10 @@ - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; - [tableController release]; - [messageField release]; - [sendButton release]; - [editButton release]; - [addressLabel release]; - [avatarImage release]; - [headerView release]; - [messageView release]; - [messageBackgroundImage release]; - [transferBackgroundImage release]; - [listTapGestureRecognizer release]; - [listSwipeGestureRecognizer release]; - [transferView release]; - [pictureButton release]; - [imageTransferProgressBar release]; - [cancelTransferButton release]; - [imageQualities release]; - [waitView release]; - [composeLabel release]; - [composeIndicatorView release]; - [super dealloc]; } @@ -277,7 +256,6 @@ static UICompositeViewDescription *compositeDescription = nil; cancelButtonTitle:NSLocalizedString(@"Continue",nil) otherButtonTitles:nil]; [error show]; - [error release]; return; } char *tmp = linphone_address_as_string_uri_only(linphoneAddress); @@ -309,7 +287,7 @@ static UICompositeViewDescription *compositeDescription = nil; } static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState state,void* ud) { - ChatRoomViewController* thiz = (ChatRoomViewController*)ud; + ChatRoomViewController* thiz = (__bridge ChatRoomViewController*)ud; const char*text = linphone_chat_message_get_text(msg); LOGI(@"Delivery status for [%s] is [%s]",text,linphone_chat_message_state_to_string(state)); [thiz.tableController updateChatEntry:msg]; @@ -326,7 +304,7 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta linphone_chat_message_set_external_body_url(msg, [[externalUrl absoluteString] UTF8String]); } - linphone_chat_room_send_message2(chatRoom, msg, message_status, self); + linphone_chat_room_send_message2(chatRoom, msg, message_status, (__bridge void *)(self)); if ( internalUrl ) { // internal url is saved in the appdata for display and later save @@ -357,7 +335,6 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta cancelButtonTitle:NSLocalizedString(@"Ok",nil) otherButtonTitles:nil ,nil]; [errorAlert show]; - [errorAlert release]; return; } LOGI(@"Image saved to [%@]", [assetURL absoluteString]); @@ -584,7 +561,7 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta } }; - DTActionSheet *sheet = [[[DTActionSheet alloc] initWithTitle:NSLocalizedString(@"Select picture source",nil)] autorelease]; + DTActionSheet *sheet = [[DTActionSheet alloc] initWithTitle:NSLocalizedString(@"Select picture source",nil)]; if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) { [sheet addButtonWithTitle:NSLocalizedString(@"Camera",nil) block:^(){ block(UIImagePickerControllerSourceTypeCamera); @@ -643,7 +620,6 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta - (void)imageSharingAborted:(ImageSharing*)aimageSharing { [messageView setHidden:FALSE]; [transferView setHidden:TRUE]; - [imageSharing release]; imageSharing = nil; } @@ -659,7 +635,6 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta cancelButtonTitle:NSLocalizedString(@"Ok",nil) otherButtonTitles:nil ,nil]; [errorAlert show]; - [errorAlert release]; } else { LOGE(@"Cannot download file from [%@] because [%@]", url, [error localizedDescription]); UIAlertView* errorAlert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Transfer error", nil) @@ -668,7 +643,6 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta cancelButtonTitle:NSLocalizedString(@"Continue", nil) otherButtonTitles:nil, nil]; [errorAlert show]; - [errorAlert release]; } imageSharing = nil; } @@ -698,7 +672,6 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta cancelButtonTitle:NSLocalizedString(@"Ok",nil) otherButtonTitles:nil ,nil]; [errorAlert show]; - [errorAlert release]; return; } LOGI(@"Image saved to [%@]", [assetURL absoluteString]); diff --git a/Classes/ChatTableViewController.m b/Classes/ChatTableViewController.m index 1ead38eb0..77f0bc07e 100644 --- a/Classes/ChatTableViewController.m +++ b/Classes/ChatTableViewController.m @@ -34,9 +34,6 @@ #pragma mark - Lifecycle Functions -- (void)dealloc { - [super dealloc]; -} #pragma mark - ViewController Functions @@ -115,10 +112,10 @@ static void chatTable_free_chatrooms(void *data){ static NSString *kCellId = @"UIChatCell"; UIChatCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellId]; if (cell == nil) { - cell = [[[UIChatCell alloc] initWithIdentifier:kCellId] autorelease]; + cell = [[UIChatCell alloc] initWithIdentifier:kCellId]; // Background View - UACellBackgroundView *selectedBackgroundView = [[[UACellBackgroundView alloc] initWithFrame:CGRectZero] autorelease]; + UACellBackgroundView *selectedBackgroundView = [[UACellBackgroundView alloc] initWithFrame:CGRectZero]; cell.selectedBackgroundView = selectedBackgroundView; [selectedBackgroundView setBackgroundColor:LINPHONE_TABLE_CELL_BACKGROUND_COLOR]; } diff --git a/Classes/ChatViewController.h b/Classes/ChatViewController.h index 1ac291235..2c102b4b1 100644 --- a/Classes/ChatViewController.h +++ b/Classes/ChatViewController.h @@ -27,9 +27,9 @@ @interface ChatViewController : UIViewController { } -@property (nonatomic, retain) IBOutlet ChatTableViewController* tableController; -@property (nonatomic, retain) IBOutlet UIToggleButton *editButton; -@property (nonatomic, retain) IBOutlet UITextField *addressField; +@property (nonatomic, strong) IBOutlet ChatTableViewController* tableController; +@property (nonatomic, strong) IBOutlet UIToggleButton *editButton; +@property (nonatomic, strong) IBOutlet UITextField *addressField; - (IBAction)onAddClick:(id) event; - (IBAction)onEditClick:(id) event; diff --git a/Classes/ChatViewController.m b/Classes/ChatViewController.m index 437717dbb..13119a454 100644 --- a/Classes/ChatViewController.m +++ b/Classes/ChatViewController.m @@ -36,11 +36,7 @@ - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; - [tableController release]; - [editButton release]; - [addressField release]; - [super dealloc]; } #pragma mark - ViewController Functions @@ -123,7 +119,6 @@ static UICompositeViewDescription *compositeDescription = nil; cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:nil]; [alert show]; - [alert release]; } addressField.text = @""; diff --git a/Classes/ContactDetailsLabelViewController.h b/Classes/ContactDetailsLabelViewController.h index b03ecb175..850cf7fe1 100644 --- a/Classes/ContactDetailsLabelViewController.h +++ b/Classes/ContactDetailsLabelViewController.h @@ -30,9 +30,9 @@ } @property (nonatomic, copy) NSString *selectedData; -@property (nonatomic, retain) NSDictionary *dataList; -@property (nonatomic, retain) IBOutlet UITableView *tableView; -@property (nonatomic, retain) id delegate; +@property (nonatomic, strong) NSDictionary *dataList; +@property (nonatomic, strong) IBOutlet UITableView *tableView; +@property (nonatomic, strong) id delegate; - (IBAction)onBackClick:(id)event; diff --git a/Classes/ContactDetailsLabelViewController.m b/Classes/ContactDetailsLabelViewController.m index d7c3374da..06fb46b5b 100644 --- a/Classes/ContactDetailsLabelViewController.m +++ b/Classes/ContactDetailsLabelViewController.m @@ -33,14 +33,6 @@ #pragma mark - Lifecycle Functions -- (void)dealloc { - [selectedData release]; - [dataList release]; - [tableView release]; - [delegate release]; - - [super dealloc]; -} #pragma mark - ViewController Functions @@ -87,16 +79,12 @@ static UICompositeViewDescription *compositeDescription = nil; if([dataList isEqualToDictionary:adatalist]) { return; } - [dataList release]; - dataList = [adatalist retain]; + dataList = adatalist; [tableView reloadData]; } - (void)setSelectedData:(NSString *)aselectedData { - if (selectedData != nil) { - [selectedData release]; - } selectedData = [[NSString alloc] initWithString:aselectedData]; [tableView reloadData]; } @@ -116,10 +104,10 @@ static UICompositeViewDescription *compositeDescription = nil; static NSString *kCellId = @"ContactDetailsLabelCell"; UITableViewCell *cell = [atableView dequeueReusableCellWithIdentifier:kCellId]; if (cell == nil) { - cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kCellId] autorelease]; + cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kCellId]; // Background View - UACellBackgroundView *selectedBackgroundView = [[[UACellBackgroundView alloc] initWithFrame:CGRectZero] autorelease]; + UACellBackgroundView *selectedBackgroundView = [[UACellBackgroundView alloc] initWithFrame:CGRectZero]; cell.selectedBackgroundView = selectedBackgroundView; [selectedBackgroundView setBackgroundColor:LINPHONE_TABLE_CELL_BACKGROUND_COLOR]; } diff --git a/Classes/ContactDetailsTableViewController.h b/Classes/ContactDetailsTableViewController.h index c51db7bab..311908db9 100644 --- a/Classes/ContactDetailsTableViewController.h +++ b/Classes/ContactDetailsTableViewController.h @@ -42,9 +42,9 @@ typedef enum _ContactSections { } @property (nonatomic, assign) ABRecordRef contact; -@property (nonatomic, retain) IBOutlet id contactDetailsDelegate; -@property (nonatomic, retain) IBOutlet UIContactDetailsHeader *headerController; -@property (nonatomic, retain) IBOutlet UIContactDetailsFooter *footerController; +@property (nonatomic, strong) IBOutlet id contactDetailsDelegate; +@property (nonatomic, strong) IBOutlet UIContactDetailsHeader *headerController; +@property (nonatomic, strong) IBOutlet UIContactDetailsFooter *footerController; - (BOOL)isValid; - (void)addPhoneField:(NSString*)number; diff --git a/Classes/ContactDetailsTableViewController.m b/Classes/ContactDetailsTableViewController.m index be6a18b35..eeb66c6dd 100644 --- a/Classes/ContactDetailsTableViewController.m +++ b/Classes/ContactDetailsTableViewController.m @@ -46,9 +46,6 @@ return self; } -- (void)dealloc { - [super dealloc]; -} @end @@ -100,13 +97,7 @@ static const ContactSections_e contactSections[ContactSections_MAX] = {ContactSe if(contact != nil && ABRecordGetRecordID(contact) == kABRecordInvalidID) { CFRelease(contact); } - if(editingIndexPath != nil) { - [editingIndexPath release]; - } - [labelArray release]; - [dataCache release]; - [super dealloc]; } @@ -160,10 +151,7 @@ static const ContactSections_e contactSections[ContactSections_MAX] = {ContactSe } + (NSString*)localizeLabel:(NSString*)str { - CFStringRef lLocalizedLabel = ABAddressBookCopyLocalizedLabel((CFStringRef) str); - NSString * retStr = [NSString stringWithString:(NSString*) lLocalizedLabel]; - CFRelease(lLocalizedLabel); - return retStr; + return (NSString*) CFBridgingRelease(ABAddressBookCopyLocalizedLabel((__bridge CFStringRef) str)); } - (NSDictionary*)getLocalizedLabels { @@ -171,7 +159,7 @@ static const ContactSections_e contactSections[ContactSections_MAX] = {ContactSe for(NSString *str in labelArray) { [dict setObject:[ContactDetailsTableViewController localizeLabel:str] forKey:str]; } - return [dict autorelease]; + return dict; } - (void)loadData { @@ -190,7 +178,6 @@ static const ContactSections_e contactSections[ContactSections_MAX] = {ContactSe ABMultiValueIdentifier identifier = ABMultiValueGetIdentifierAtIndex(lMap, i); Entry *entry = [[Entry alloc] initWithData:identifier]; [subArray addObject: entry]; - [entry release]; } CFRelease(lMap); } @@ -229,7 +216,6 @@ static const ContactSections_e contactSections[ContactSections_MAX] = {ContactSe if(add) { Entry *entry = [[Entry alloc] initWithData:identifier]; [subArray addObject: entry]; - [entry release]; } CFRelease(lDict); } @@ -249,7 +235,6 @@ static const ContactSections_e contactSections[ContactSections_MAX] = {ContactSe CFDictionaryRef lDict = ABMultiValueCopyValueAtIndex(lMap, i); Entry *entry = [[Entry alloc] initWithData:identifier]; [subArray addObject: entry]; - [entry release]; CFRelease(lDict); } CFRelease(lMap); @@ -273,25 +258,25 @@ static const ContactSections_e contactSections[ContactSections_MAX] = {ContactSe lMap = ABMultiValueCreateMutable(kABStringPropertyType); } ABMultiValueIdentifier index; - NSError* error = NULL; + CFErrorRef error = NULL; CFStringRef keys[] = { kABPersonInstantMessageUsernameKey, kABPersonInstantMessageServiceKey}; - CFTypeRef values[] = { [value copy], [LinphoneManager instance].contactSipField }; + CFTypeRef values[] = { CFBridgingRetain([value copy]), (__bridge CFTypeRef)([LinphoneManager instance].contactSipField) }; CFDictionaryRef lDict = CFDictionaryCreate(NULL, (const void **)&keys, (const void **)&values, 2, NULL, NULL); if (entry) { index = (int)ABMultiValueGetIndexForIdentifier(lMap, [entry identifier]); ABMultiValueReplaceValueAtIndex(lMap, lDict, index); } else { - CFStringRef label = (CFStringRef)[labelArray objectAtIndex:0]; + CFStringRef label = (__bridge CFStringRef)[labelArray objectAtIndex:0]; ABMultiValueAddValueAndLabel(lMap, lDict, label, &index); } - if (!ABRecordSetValue(contact, kABPersonInstantMessageProperty, lMap, (CFErrorRef*)&error)) { - LOGI(@"Can't set contact with value [%@] cause [%@]", value,[error localizedDescription]); + if (!ABRecordSetValue(contact, kABPersonInstantMessageProperty, lMap, &error)) { + LOGI(@"Can't set contact with value [%@] cause [%@]", value,[(__bridge NSError*)error localizedDescription]); CFRelease(lMap); } else { if (entry == nil) { - entry = [[[Entry alloc] initWithData:index] autorelease]; + entry = [[Entry alloc] initWithData:index]; } CFRelease(lDict); CFRelease(lMap); @@ -310,11 +295,11 @@ static const ContactSections_e contactSections[ContactSections_MAX] = {ContactSe if(address){ char* uri = linphone_address_as_string_uri_only(address); CFStringRef keys[] = { kABPersonInstantMessageUsernameKey, kABPersonInstantMessageServiceKey}; - CFTypeRef values[] = { [NSString stringWithCString:uri encoding:[NSString defaultCStringEncoding]], [LinphoneManager instance].contactSipField }; + CFTypeRef values[] = { (__bridge CFTypeRef)([NSString stringWithCString:uri encoding:[NSString defaultCStringEncoding]]), (__bridge CFTypeRef)([LinphoneManager instance].contactSipField) }; CFDictionaryRef lDict2 = CFDictionaryCreate(NULL, (const void **)&keys, (const void **)&values, 2, NULL, NULL); ABMultiValueReplaceValueAtIndex(lMap, lDict2, index); - if (!ABRecordSetValue(contact, kABPersonInstantMessageProperty, lMap, (CFErrorRef*)&error)) { - LOGI(@"Can't set contact with value [%@] cause [%@]", value,[error localizedDescription]); + if (!ABRecordSetValue(contact, kABPersonInstantMessageProperty, lMap, &error)) { + LOGI(@"Can't set contact with value [%@] cause [%@]", value,[(__bridge NSError*)error localizedDescription]); } CFRelease(lDict2); linphone_address_destroy(address); @@ -338,7 +323,7 @@ static const ContactSections_e contactSections[ContactSections_MAX] = {ContactSe - (void)addEntry:(UITableView*)tableview section:(NSInteger)section animated:(BOOL)animated value:(NSString *)value{ NSMutableArray *sectionArray = [self getSectionData:section]; NSUInteger count = [sectionArray count]; - NSError* error = NULL; + CFErrorRef error = NULL; bool added = TRUE; if(contactSections[section] == ContactSections_Number) { ABMultiValueIdentifier identifier; @@ -350,18 +335,17 @@ static const ContactSections_e contactSections[ContactSections_MAX] = {ContactSe } else { lMap = ABMultiValueCreateMutable(kABStringPropertyType); } - CFStringRef label = (CFStringRef)[labelArray objectAtIndex:0]; - if(!ABMultiValueAddValueAndLabel(lMap, [[value copy] autorelease], label, &identifier)) { + CFStringRef label = (__bridge CFStringRef)[labelArray objectAtIndex:0]; + if(!ABMultiValueAddValueAndLabel(lMap, CFBridgingRetain([value copy]), label, &identifier)) { added = false; } - if(added && ABRecordSetValue(contact, kABPersonPhoneProperty, lMap, (CFErrorRef*)&error)) { + if(added && ABRecordSetValue(contact, kABPersonPhoneProperty, lMap, &error)) { Entry *entry = [[Entry alloc] initWithData:identifier]; [sectionArray addObject:entry]; - [entry release]; } else { added = false; - LOGI(@"Can't add entry: %@", [error localizedDescription]); + LOGI(@"Can't add entry: %@", [(__bridge NSError*)error localizedDescription]); } CFRelease(lMap); } else if(contactSections[section] == ContactSections_Sip) { @@ -383,18 +367,17 @@ static const ContactSections_e contactSections[ContactSections_MAX] = {ContactSe } else { lMap = ABMultiValueCreateMutable(kABStringPropertyType); } - CFStringRef label = (CFStringRef)[labelArray objectAtIndex:0]; - if(!ABMultiValueAddValueAndLabel(lMap, [[value copy] autorelease], label, &identifier)) { + CFStringRef label = (__bridge CFStringRef)[labelArray objectAtIndex:0]; + if(!ABMultiValueAddValueAndLabel(lMap, CFBridgingRetain([value copy]), label, &identifier)) { added = false; } - if(added && ABRecordSetValue(contact, kABPersonEmailProperty, lMap, (CFErrorRef*)&error)) { + if(added && ABRecordSetValue(contact, kABPersonEmailProperty, lMap, &error)) { Entry *entry = [[Entry alloc] initWithData:identifier]; [sectionArray addObject:entry]; - [entry release]; } else { added = false; - LOGI(@"Can't add entry: %@", [error localizedDescription]); + LOGI(@"Can't add entry: %@", [(__bridge NSError*)error localizedDescription]); } CFRelease(lMap); } @@ -427,7 +410,7 @@ static const ContactSections_e contactSections[ContactSections_MAX] = {ContactSe // when we query the instanteMsg property we get a dictionary instead of a value valueRef = CFDictionaryGetValue(valueRef, kABPersonInstantMessageUsernameKey); } - if(![(NSString*) valueRef length]) { + if(![(__bridge NSString*) valueRef length]) { [self removeEntry:tableview path:[NSIndexPath indexPathForRow:row inSection:section] animated:animated]; } CFRelease(toRelease); @@ -508,14 +491,14 @@ static const ContactSections_e contactSections[ContactSections_MAX] = {ContactSe static NSString *kCellId = @"ContactDetailsCell"; UIEditableTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellId]; if (cell == nil) { - cell = [[[UIEditableTableViewCell alloc] initWithStyle:UITableViewCellStyleValue2 reuseIdentifier:kCellId] autorelease]; + cell = [[UIEditableTableViewCell alloc] initWithStyle:UITableViewCellStyleValue2 reuseIdentifier:kCellId]; [cell.detailTextField setDelegate:self]; [cell.detailTextField setAutocapitalizationType:UITextAutocapitalizationTypeNone]; [cell.detailTextField setAutocorrectionType:UITextAutocorrectionTypeNo]; [cell setBackgroundColor:[UIColor whiteColor]]; // Background View - UACellBackgroundView *selectedBackgroundView = [[[UACellBackgroundView alloc] initWithFrame:CGRectZero] autorelease]; + UACellBackgroundView *selectedBackgroundView = [[UACellBackgroundView alloc] initWithFrame:CGRectZero]; cell.selectedBackgroundView = selectedBackgroundView; [selectedBackgroundView setBackgroundColor:LINPHONE_TABLE_CELL_BACKGROUND_COLOR]; } @@ -532,13 +515,11 @@ static const ContactSections_e contactSections[ContactSections_MAX] = {ContactSe NSInteger index = ABMultiValueGetIndexForIdentifier(lMap, [entry identifier]); CFStringRef labelRef = ABMultiValueCopyLabelAtIndex(lMap, index); if(labelRef != NULL) { - label = [ContactDetailsTableViewController localizeLabel:(NSString*) labelRef]; - CFRelease(labelRef); + label = [ContactDetailsTableViewController localizeLabel:(NSString*) CFBridgingRelease(labelRef)]; } - CFStringRef valueRef = ABMultiValueCopyValueAtIndex(lMap, index); + NSString* valueRef = CFBridgingRelease(ABMultiValueCopyValueAtIndex(lMap, index)); if(valueRef != NULL) { - value = [ContactDetailsTableViewController localizeLabel:(NSString*) valueRef]; - CFRelease(valueRef); + value = [ContactDetailsTableViewController localizeLabel:valueRef]; } CFRelease(lMap); } else if(contactSections[[indexPath section]] == ContactSections_Sip) { @@ -546,21 +527,20 @@ static const ContactSections_e contactSections[ContactSections_MAX] = {ContactSe NSInteger index = ABMultiValueGetIndexForIdentifier(lMap, [entry identifier]); CFStringRef labelRef = ABMultiValueCopyLabelAtIndex(lMap, index); if(labelRef != NULL) { - label = [ContactDetailsTableViewController localizeLabel:(NSString*) labelRef]; - CFRelease(labelRef); + label = [ContactDetailsTableViewController localizeLabel:(NSString*) CFBridgingRelease(labelRef)]; } CFDictionaryRef lDict = ABMultiValueCopyValueAtIndex(lMap, index); CFStringRef valueRef = CFDictionaryGetValue(lDict, kABPersonInstantMessageUsernameKey); if(valueRef != NULL) { LinphoneAddress* addr=NULL; if ([[LinphoneManager instance] lpConfigBoolForKey:@"contact_display_username_only"] - && (addr=linphone_address_new([(NSString *)valueRef UTF8String]))) { + && (addr=linphone_address_new([(NSString *)CFBridgingRelease(valueRef) UTF8String]))) { if (linphone_address_get_username(addr)) { value = [NSString stringWithCString:linphone_address_get_username(addr) encoding:[NSString defaultCStringEncoding]]; } /*else value=@""*/ } else { - value = [NSString stringWithString:(NSString*) valueRef]; + value = (NSString*) CFBridgingRelease(valueRef); } if (addr) linphone_address_destroy(addr); } @@ -571,13 +551,11 @@ static const ContactSections_e contactSections[ContactSections_MAX] = {ContactSe NSInteger index = ABMultiValueGetIndexForIdentifier(lMap, [entry identifier]); CFStringRef labelRef = ABMultiValueCopyLabelAtIndex(lMap, index); if(labelRef != NULL) { - label = [ContactDetailsTableViewController localizeLabel:(NSString*) labelRef]; - CFRelease(labelRef); + label = [ContactDetailsTableViewController localizeLabel:(NSString*) CFBridgingRelease(labelRef)]; } CFStringRef valueRef = ABMultiValueCopyValueAtIndex(lMap, index); if(valueRef != NULL) { - value = [ContactDetailsTableViewController localizeLabel:(NSString*) valueRef]; - CFRelease(valueRef); + value = [ContactDetailsTableViewController localizeLabel:(NSString*) CFBridgingRelease(valueRef)]; } CFRelease(lMap); } @@ -608,8 +586,7 @@ static const ContactSections_e contactSections[ContactSections_MAX] = {ContactSe NSInteger index = ABMultiValueGetIndexForIdentifier(lMap, [entry identifier]); CFStringRef valueRef = ABMultiValueCopyValueAtIndex(lMap, index); if(valueRef != NULL) { - dest = [ContactDetailsTableViewController localizeLabel:(NSString*) valueRef]; - CFRelease(valueRef); + dest = [ContactDetailsTableViewController localizeLabel:(NSString*) CFBridgingRelease(valueRef)]; } CFRelease(lMap); } else if(contactSections[[indexPath section]] == ContactSections_Sip) { @@ -617,7 +594,7 @@ static const ContactSections_e contactSections[ContactSections_MAX] = {ContactSe NSInteger index = ABMultiValueGetIndexForIdentifier(lMap, [entry identifier]); CFDictionaryRef lDict = ABMultiValueCopyValueAtIndex(lMap, index); CFStringRef valueRef = CFDictionaryGetValue(lDict, kABPersonInstantMessageUsernameKey); - dest = [FastAddressBook normalizeSipURI:[NSString stringWithString:(NSString*) valueRef]]; + dest = [FastAddressBook normalizeSipURI:(NSString*) CFBridgingRelease(valueRef)]; CFRelease(lDict); CFRelease(lMap); } else if(contactSections[[indexPath section]] == ContactSections_Email) { @@ -625,8 +602,7 @@ static const ContactSections_e contactSections[ContactSections_MAX] = {ContactSe NSInteger index = ABMultiValueGetIndexForIdentifier(lMap, [entry identifier]); CFStringRef valueRef = ABMultiValueCopyValueAtIndex(lMap, index); if(valueRef != NULL) { - dest = [FastAddressBook normalizeSipURI:[NSString stringWithString:(NSString*) valueRef]]; - CFRelease(valueRef); + dest = [FastAddressBook normalizeSipURI:(NSString*) CFBridgingRelease(valueRef)]; } CFRelease(lMap); } @@ -657,15 +633,11 @@ static const ContactSections_e contactSections[ContactSections_MAX] = {ContactSe NSInteger index = ABMultiValueGetIndexForIdentifier(lMap, [entry identifier]); CFTypeRef labelRef = ABMultiValueCopyLabelAtIndex(lMap, index); if(labelRef != NULL) { - key = [NSString stringWithString:(NSString*) labelRef]; - CFRelease(labelRef); + key = (NSString*) CFBridgingRelease(labelRef); } CFRelease(lMap); } if(key != nil) { - if(editingIndexPath != nil) { - [editingIndexPath release]; - } editingIndexPath = [indexPath copy]; ContactDetailsLabelViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[ContactDetailsLabelViewController compositeViewDescription] push:TRUE], ContactDetailsLabelViewController); if(controller != nil) { @@ -821,7 +793,7 @@ static const ContactSections_e contactSections[ContactSections_MAX] = {ContactSe ABMutableMultiValueRef lMap = ABMultiValueCreateMutableCopy(lcMap); CFRelease(lcMap); NSInteger index = ABMultiValueGetIndexForIdentifier(lMap, [entry identifier]); - ABMultiValueReplaceLabelAtIndex(lMap, (CFStringRef)(value), index); + ABMultiValueReplaceLabelAtIndex(lMap, (__bridge CFStringRef)(value), index); ABRecordSetValue(contact, kABPersonPhoneProperty, lMap, nil); CFRelease(lMap); } @@ -831,7 +803,6 @@ static const ContactSections_e contactSections[ContactSections_MAX] = {ContactSe [self.tableView reloadSectionIndexTitles]; [self.tableView endUpdates]; } - [editingIndexPath release]; editingIndexPath = nil; } @@ -871,7 +842,7 @@ static const ContactSections_e contactSections[ContactSections_MAX] = {ContactSe ABMutableMultiValueRef lMap = ABMultiValueCreateMutableCopy(lcMap); CFRelease(lcMap); NSInteger index = ABMultiValueGetIndexForIdentifier(lMap, [entry identifier]); - ABMultiValueReplaceValueAtIndex(lMap, (CFStringRef)value, index); + ABMultiValueReplaceValueAtIndex(lMap, (__bridge CFStringRef)value, index); ABRecordSetValue(contact, property, lMap, nil); CFRelease(lMap); } diff --git a/Classes/ContactDetailsViewController.h b/Classes/ContactDetailsViewController.h index cc445a0c3..b59c79433 100644 --- a/Classes/ContactDetailsViewController.h +++ b/Classes/ContactDetailsViewController.h @@ -30,10 +30,10 @@ } @property (nonatomic, assign) ABRecordRef contact; -@property (nonatomic, retain) IBOutlet ContactDetailsTableViewController *tableController; -@property (nonatomic, retain) IBOutlet UIToggleButton *editButton; -@property (nonatomic, retain) IBOutlet UIButton *backButton; -@property (nonatomic, retain) IBOutlet UIButton *cancelButton; +@property (nonatomic, strong) IBOutlet ContactDetailsTableViewController *tableController; +@property (nonatomic, strong) IBOutlet UIToggleButton *editButton; +@property (nonatomic, strong) IBOutlet UIButton *backButton; +@property (nonatomic, strong) IBOutlet UIButton *cancelButton; - (IBAction)onBackClick:(id)event; - (IBAction)onCancelClick:(id)event; diff --git a/Classes/ContactDetailsViewController.m b/Classes/ContactDetailsViewController.m index d37ab5384..e579d30d8 100644 --- a/Classes/ContactDetailsViewController.m +++ b/Classes/ContactDetailsViewController.m @@ -38,21 +38,16 @@ static void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef inf if(self != nil) { inhibUpdate = FALSE; addressBook = ABAddressBookCreateWithOptions(nil, nil); - ABAddressBookRegisterExternalChangeCallback(addressBook, sync_address_book, self); + ABAddressBookRegisterExternalChangeCallback(addressBook, sync_address_book, (__bridge void *)(self)); } return self; } - (void)dealloc { - ABAddressBookUnregisterExternalChangeCallback(addressBook, sync_address_book, self); + ABAddressBookUnregisterExternalChangeCallback(addressBook, sync_address_book, (__bridge void *)(self)); CFRelease(addressBook); - [tableController release]; - [editButton release]; - [backButton release]; - [cancelButton release]; - [super dealloc]; } @@ -77,7 +72,7 @@ static void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef inf } static void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef info, void *context) { - ContactDetailsViewController* controller = (ContactDetailsViewController*)context; + ContactDetailsViewController* controller = (__bridge ContactDetailsViewController*)context; if(!controller->inhibUpdate && ![[controller tableController] isEditing]) { [controller resetData]; } @@ -91,10 +86,10 @@ static void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef inf // Remove contact from book if(ABRecordGetRecordID(contact) != kABRecordInvalidID) { - NSError* error = NULL; + CFErrorRef error = NULL; ABAddressBookRemoveRecord(addressBook, contact, (CFErrorRef*)&error); if (error != NULL) { - LOGE(@"Remove contact %p: Fail(%@)", contact, [error localizedDescription]); + LOGE(@"Remove contact %p: Fail(%@)", contact, [(__bridge NSError*)error localizedDescription]); } else { LOGI(@"Remove contact %p: Success!", contact); } @@ -106,7 +101,7 @@ static void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef inf ABAddressBookSave(addressBook, (CFErrorRef*)&error); inhibUpdate = FALSE; if (error != NULL) { - LOGE(@"Save AddressBook: Fail(%@)", [error localizedDescription]); + LOGE(@"Save AddressBook: Fail(%@)", [(__bridge NSError*)error localizedDescription]); } else { LOGI(@"Save AddressBook: Success!"); } @@ -121,11 +116,11 @@ static void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef inf } // Add contact to book - NSError* error = NULL; + CFErrorRef error = NULL; if(ABRecordGetRecordID(contact) == kABRecordInvalidID) { ABAddressBookAddRecord(addressBook, contact, (CFErrorRef*)&error); if (error != NULL) { - LOGE(@"Add contact %p: Fail(%@)", contact, [error localizedDescription]); + LOGE(@"Add contact %p: Fail(%@)", contact, [(__bridge NSError*)error localizedDescription]); } else { LOGI(@"Add contact %p: Success!", contact); } @@ -137,7 +132,7 @@ static void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef inf ABAddressBookSave(addressBook, (CFErrorRef*)&error); inhibUpdate = FALSE; if (error != NULL) { - LOGE(@"Save AddressBook: Fail(%@)", [error localizedDescription]); + LOGE(@"Save AddressBook: Fail(%@)", [(__bridge NSError*)error localizedDescription]); } else { LOGI(@"Save AddressBook: Success!"); } diff --git a/Classes/ContactsTableViewController.m b/Classes/ContactsTableViewController.m index a87dbfd0d..4ef8e7dc7 100644 --- a/Classes/ContactsTableViewController.m +++ b/Classes/ContactsTableViewController.m @@ -38,7 +38,7 @@ static void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef inf addressBook = ABAddressBookCreateWithOptions(nil, nil); - ABAddressBookRegisterExternalChangeCallback(addressBook, sync_address_book, self); + ABAddressBookRegisterExternalChangeCallback(addressBook, sync_address_book, (__bridge void *)(self)); } - (id)init { @@ -58,11 +58,8 @@ static void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef inf } - (void)dealloc { - ABAddressBookUnregisterExternalChangeCallback(addressBook, sync_address_book, self); + ABAddressBookUnregisterExternalChangeCallback(addressBook, sync_address_book, (__bridge void *)(self)); CFRelease(addressBook); - [addressBookMap release]; - [avatarMap release]; - [super dealloc]; } @@ -133,10 +130,10 @@ static int ms_strcmpfuz(const char * fuzzy_word, const char * sentence) { // Reset Address book [addressBookMap removeAllObjects]; - NSArray *lContacts = (NSArray *)ABAddressBookCopyArrayOfAllPeople(addressBook); + NSArray *lContacts = (NSArray *)CFBridgingRelease(ABAddressBookCopyArrayOfAllPeople(addressBook)); for (id lPerson in lContacts) { BOOL add = true; - ABRecordRef person = (ABRecordRef)lPerson; + ABRecordRef person = (ABRecordRef)CFBridgingRetain(lPerson); // Do not add the contact directly if we set some filter if([ContactSelection getSipFilter] || [ContactSelection emailFilterEnabled]) { @@ -154,21 +151,21 @@ static int ms_strcmpfuz(const char * fuzzy_word, const char * sentence) { } if(add) { - CFStringRef lFirstName = ABRecordCopyValue(person, kABPersonFirstNameProperty); - CFStringRef lLocalizedFirstName = (lFirstName != nil)? ABAddressBookCopyLocalizedLabel(lFirstName): nil; - CFStringRef lLastName = ABRecordCopyValue(person, kABPersonLastNameProperty); - CFStringRef lLocalizedLastName = (lLastName != nil)? ABAddressBookCopyLocalizedLabel(lLastName): nil; - CFStringRef lOrganization = ABRecordCopyValue(person, kABPersonOrganizationProperty); - CFStringRef lLocalizedlOrganization = (lOrganization != nil)? ABAddressBookCopyLocalizedLabel(lOrganization): nil; + NSString* lFirstName = CFBridgingRelease(ABRecordCopyValue(person, kABPersonFirstNameProperty)); + NSString* lLocalizedFirstName = (lFirstName != nil)? CFBridgingRelease(ABAddressBookCopyLocalizedLabel((__bridge CFStringRef)(lFirstName))): nil; + NSString* lLastName = CFBridgingRelease(ABRecordCopyValue(person, kABPersonLastNameProperty)); + NSString* lLocalizedLastName = (lLastName != nil)? CFBridgingRelease(ABAddressBookCopyLocalizedLabel((__bridge CFStringRef)(lLastName))): nil; + NSString* lOrganization = CFBridgingRelease(ABRecordCopyValue(person, kABPersonOrganizationProperty)); + NSString* lLocalizedlOrganization = (lOrganization != nil)? CFBridgingRelease(ABAddressBookCopyLocalizedLabel((__bridge CFStringRef)lOrganization)): nil; NSString *name = nil; if(lLocalizedFirstName != nil && lLocalizedLastName != nil) { - name=[NSString stringWithFormat:@"%@ %@", [(NSString *)lLocalizedFirstName retain], [(NSString *)lLocalizedLastName retain]]; + name=[NSString stringWithFormat:@"%@ %@", lLocalizedFirstName, lLocalizedLastName]; } else if(lLocalizedLastName != nil) { - name=[NSString stringWithFormat:@"%@",[(NSString *)lLocalizedLastName retain]]; + name=[NSString stringWithFormat:@"%@",lLocalizedLastName]; } else if(lLocalizedFirstName != nil) { - name=[NSString stringWithFormat:@"%@",[(NSString *)lLocalizedFirstName retain]]; + name=[NSString stringWithFormat:@"%@",lLocalizedFirstName]; } else if(lLocalizedlOrganization != nil) { - name=[NSString stringWithFormat:@"%@",[(NSString *)lLocalizedlOrganization retain]]; + name=[NSString stringWithFormat:@"%@",lLocalizedlOrganization]; } if(name != nil && [name length] > 0) { @@ -179,7 +176,7 @@ static int ms_strcmpfuz(const char * fuzzy_word, const char * sentence) { //Sort contacts by first letter. We need to translate the name to ASCII first, because of UTF-8 issues. For instance // we expect order: Alberta(A tilde) before ASylvano. NSData *name2ASCIIdata = [name dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES]; - NSString *name2ASCII = [[[NSString alloc] initWithData:name2ASCIIdata encoding:NSASCIIStringEncoding] autorelease]; + NSString *name2ASCII = [[NSString alloc] initWithData:name2ASCIIdata encoding:NSASCIIStringEncoding]; NSString *firstChar = [[name2ASCII substringToIndex:1] uppercaseString]; // Put in correct subDic @@ -188,34 +185,20 @@ static int ms_strcmpfuz(const char * fuzzy_word, const char * sentence) { } OrderedDictionary *subDic =[addressBookMap objectForKey: firstChar]; if(subDic == nil) { - subDic = [[[OrderedDictionary alloc] init] autorelease]; + subDic = [[OrderedDictionary alloc] init]; [addressBookMap insertObject:subDic forKey:firstChar selector:@selector(caseInsensitiveCompare:)]; } [subDic insertObject:lPerson forKey:name2ASCII selector:@selector(caseInsensitiveCompare:)]; } } - if(lLocalizedlOrganization != nil) - CFRelease(lLocalizedlOrganization); - if(lOrganization != nil) - CFRelease(lOrganization); - if(lLocalizedLastName != nil) - CFRelease(lLocalizedLastName); - if(lLastName != nil) - CFRelease(lLastName); - if(lLocalizedFirstName != nil) - CFRelease(lLocalizedFirstName); - if(lFirstName != nil) - CFRelease(lFirstName); } } - if (lContacts) - CFRelease(lContacts); } [self.tableView reloadData]; } static void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef info, void *context) { - ContactsTableViewController* controller = (ContactsTableViewController*)context; + ContactsTableViewController* controller = (__bridge ContactsTableViewController*)context; ABAddressBookRevert(addressBook); [controller->avatarMap removeAllObjects]; [controller loadData]; @@ -247,17 +230,17 @@ static void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef inf static NSString *kCellId = @"UIContactCell"; UIContactCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellId]; if (cell == nil) { - cell = [[[UIContactCell alloc] initWithIdentifier:kCellId] autorelease]; + cell = [[UIContactCell alloc] initWithIdentifier:kCellId]; // Background View - UACellBackgroundView *selectedBackgroundView = [[[UACellBackgroundView alloc] initWithFrame:CGRectZero] autorelease]; + UACellBackgroundView *selectedBackgroundView = [[UACellBackgroundView alloc] initWithFrame:CGRectZero]; cell.selectedBackgroundView = selectedBackgroundView; [selectedBackgroundView setBackgroundColor:LINPHONE_TABLE_CELL_BACKGROUND_COLOR]; } OrderedDictionary *subDic = [addressBookMap objectForKey: [addressBookMap keyAtIndex: [indexPath section]]]; NSString *key = [[subDic allKeys] objectAtIndex:[indexPath row]]; - ABRecordRef contact = [subDic objectForKey:key]; + ABRecordRef contact = (__bridge ABRecordRef)([subDic objectForKey:key]); // Cached avatar UIImage *image = nil; @@ -287,7 +270,7 @@ static void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef inf - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { OrderedDictionary *subDic = [addressBookMap objectForKey: [addressBookMap keyAtIndex: [indexPath section]]]; - ABRecordRef lPerson = [subDic objectForKey: [subDic keyAtIndex:[indexPath row]]]; + ABRecordRef lPerson = (__bridge ABRecordRef)([subDic objectForKey: [subDic keyAtIndex:[indexPath row]]]); // Go to Contact details view ContactDetailsViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[ContactDetailsViewController compositeViewDescription] push:TRUE], ContactDetailsViewController); diff --git a/Classes/ContactsViewController.h b/Classes/ContactsViewController.h index 6e726ab41..064c8ea73 100644 --- a/Classes/ContactsViewController.h +++ b/Classes/ContactsViewController.h @@ -79,15 +79,15 @@ typedef enum _ContactSelectionMode { BOOL use_systemView; } -@property (nonatomic, retain) IBOutlet ContactsTableViewController* tableController; -@property (nonatomic, retain) IBOutlet UITableView *tableView; -@property (nonatomic, retain) IBOutlet UINavigationController* sysViewController; -@property (retain, nonatomic) IBOutlet UIView *toolBar; -@property (nonatomic, retain) IBOutlet UIButton* allButton; -@property (nonatomic, retain) IBOutlet UIButton* linphoneButton; -@property (nonatomic, retain) IBOutlet UIButton *backButton; -@property (nonatomic, retain) IBOutlet UIButton *addButton; -@property (retain, nonatomic) IBOutlet UISearchBar *searchBar; +@property (nonatomic, strong) IBOutlet ContactsTableViewController* tableController; +@property (nonatomic, strong) IBOutlet UITableView *tableView; +@property (nonatomic, strong) IBOutlet UINavigationController* sysViewController; +@property (strong, nonatomic) IBOutlet UIView *toolBar; +@property (nonatomic, strong) IBOutlet UIButton* allButton; +@property (nonatomic, strong) IBOutlet UIButton* linphoneButton; +@property (nonatomic, strong) IBOutlet UIButton *backButton; +@property (nonatomic, strong) IBOutlet UIButton *addButton; +@property (strong, nonatomic) IBOutlet UISearchBar *searchBar; - (IBAction)onAllClick:(id)event; - (IBAction)onLinphoneClick:(id)event; diff --git a/Classes/ContactsViewController.m b/Classes/ContactsViewController.m index 07671e7d5..3bcafae08 100644 --- a/Classes/ContactsViewController.m +++ b/Classes/ContactsViewController.m @@ -41,11 +41,10 @@ static NSString* sNameOrEmailFilter; + (void)setAddAddress:(NSString*)address { if(sAddAddress != nil) { - [sAddAddress release]; sAddAddress= nil; } if(address != nil) { - sAddAddress = [address retain]; + sAddAddress = address; } } @@ -54,8 +53,7 @@ static NSString* sNameOrEmailFilter; } + (void)setSipFilter:(NSString*)domain { - [sSipFilter release]; - sSipFilter = [domain retain]; + sSipFilter = domain; } + (NSString*)getSipFilter { @@ -71,8 +69,7 @@ static NSString* sNameOrEmailFilter; } + (void)setNameOrEmailFilter:(NSString*)fuzzyName { - [sNameOrEmailFilter release]; - sNameOrEmailFilter = [fuzzyName retain]; + sNameOrEmailFilter = fuzzyName; } + (NSString*)getNameOrEmailFilter { @@ -109,18 +106,6 @@ typedef enum _HistoryView { return [super initWithNibName:@"ContactsViewController" bundle:[NSBundle mainBundle]]; } -- (void)dealloc { - [tableController release]; - [tableView release]; - - [allButton release]; - [linphoneButton release]; - [backButton release]; - [addButton release]; - - [_searchBar release]; - [super dealloc]; -} #pragma mark - UICompositeViewDelegate Functions @@ -181,8 +166,8 @@ static UICompositeViewDescription *compositeDescription = nil; } else if( !use_system && !self.tableController ){ - self.tableController = [[[ContactsTableViewController alloc] init] autorelease]; - self.tableView = [[[UITableView alloc] init] autorelease]; + self.tableController = [[ContactsTableViewController alloc] init]; + self.tableView = [[UITableView alloc] init]; self.tableController.view = self.tableView; @@ -213,7 +198,6 @@ static UICompositeViewDescription *compositeDescription = nil; cancelButtonTitle:NSLocalizedString(@"Continue",nil) otherButtonTitles:nil]; [error show]; - [error release]; [[PhoneMainView instance] changeCurrentView:[DialerViewController compositeViewDescription]]; } } @@ -356,13 +340,12 @@ static UICompositeViewDescription *compositeDescription = nil; CFTypeRef multiValue = ABRecordCopyValue(person, property); CFIndex valueIdx = ABMultiValueGetIndexForIdentifier(multiValue,identifier); - NSString *phoneNumber = (NSString *)ABMultiValueCopyValueAtIndex(multiValue, valueIdx); + NSString *phoneNumber = (NSString *)CFBridgingRelease(ABMultiValueCopyValueAtIndex(multiValue, valueIdx)); // Go to dialer view DialerViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[DialerViewController compositeViewDescription]], DialerViewController); if(controller != nil) { - [controller call:phoneNumber displayName:[(NSString*)ABRecordCopyCompositeName(person) autorelease]]; + [controller call:phoneNumber displayName:(NSString*)CFBridgingRelease(ABRecordCopyCompositeName(person))]; } - [phoneNumber release]; CFRelease(multiValue); return false; } diff --git a/Classes/DialerViewController.h b/Classes/DialerViewController.h index d97d612df..938d8ce07 100644 --- a/Classes/DialerViewController.h +++ b/Classes/DialerViewController.h @@ -36,29 +36,29 @@ @property (nonatomic, assign) BOOL transferMode; -@property (nonatomic, retain) IBOutlet UITextField* addressField; -@property (nonatomic, retain) IBOutlet UIButton* addContactButton; -@property (nonatomic, retain) IBOutlet UICallButton* callButton; -@property (nonatomic, retain) IBOutlet UICallButton* addCallButton; -@property (nonatomic, retain) IBOutlet UITransferButton* transferButton; -@property (nonatomic, retain) IBOutlet UIButton* backButton; -@property (nonatomic, retain) IBOutlet UIEraseButton* eraseButton; +@property (nonatomic, strong) IBOutlet UITextField* addressField; +@property (nonatomic, strong) IBOutlet UIButton* addContactButton; +@property (nonatomic, strong) IBOutlet UICallButton* callButton; +@property (nonatomic, strong) IBOutlet UICallButton* addCallButton; +@property (nonatomic, strong) IBOutlet UITransferButton* transferButton; +@property (nonatomic, strong) IBOutlet UIButton* backButton; +@property (nonatomic, strong) IBOutlet UIEraseButton* eraseButton; -@property (nonatomic, retain) IBOutlet UIDigitButton* oneButton; -@property (nonatomic, retain) IBOutlet UIDigitButton* twoButton; -@property (nonatomic, retain) IBOutlet UIDigitButton* threeButton; -@property (nonatomic, retain) IBOutlet UIDigitButton* fourButton; -@property (nonatomic, retain) IBOutlet UIDigitButton* fiveButton; -@property (nonatomic, retain) IBOutlet UIDigitButton* sixButton; -@property (nonatomic, retain) IBOutlet UIDigitButton* sevenButton; -@property (nonatomic, retain) IBOutlet UIDigitButton* eightButton; -@property (nonatomic, retain) IBOutlet UIDigitButton* nineButton; -@property (nonatomic, retain) IBOutlet UIDigitButton* starButton; -@property (nonatomic, retain) IBOutlet UIDigitButton* zeroButton; -@property (nonatomic, retain) IBOutlet UIDigitButton* sharpButton; -@property (nonatomic, retain) IBOutlet UIView* backgroundView; -@property (nonatomic, retain) IBOutlet UIView* videoPreview; -@property (nonatomic, retain) IBOutlet UICamSwitch* videoCameraSwitch; +@property (nonatomic, strong) IBOutlet UIDigitButton* oneButton; +@property (nonatomic, strong) IBOutlet UIDigitButton* twoButton; +@property (nonatomic, strong) IBOutlet UIDigitButton* threeButton; +@property (nonatomic, strong) IBOutlet UIDigitButton* fourButton; +@property (nonatomic, strong) IBOutlet UIDigitButton* fiveButton; +@property (nonatomic, strong) IBOutlet UIDigitButton* sixButton; +@property (nonatomic, strong) IBOutlet UIDigitButton* sevenButton; +@property (nonatomic, strong) IBOutlet UIDigitButton* eightButton; +@property (nonatomic, strong) IBOutlet UIDigitButton* nineButton; +@property (nonatomic, strong) IBOutlet UIDigitButton* starButton; +@property (nonatomic, strong) IBOutlet UIDigitButton* zeroButton; +@property (nonatomic, strong) IBOutlet UIDigitButton* sharpButton; +@property (nonatomic, strong) IBOutlet UIView* backgroundView; +@property (nonatomic, strong) IBOutlet UIView* videoPreview; +@property (nonatomic, strong) IBOutlet UICamSwitch* videoCameraSwitch; - (IBAction)onAddContactClick: (id) event; - (IBAction)onBackClick: (id) event; diff --git a/Classes/DialerViewController.m b/Classes/DialerViewController.m index 9d1554211..cb50079b8 100644 --- a/Classes/DialerViewController.m +++ b/Classes/DialerViewController.m @@ -70,34 +70,12 @@ } - (void)dealloc { - [addressField release]; - [addContactButton release]; - [backButton release]; - [eraseButton release]; - [callButton release]; - [addCallButton release]; - [transferButton release]; - [oneButton release]; - [twoButton release]; - [threeButton release]; - [fourButton release]; - [fiveButton release]; - [sixButton release]; - [sevenButton release]; - [eightButton release]; - [nineButton release]; - [starButton release]; - [zeroButton release]; - [sharpButton release]; - [videoPreview release]; - [videoCameraSwitch release]; // Remove all observers [[NSNotificationCenter defaultCenter] removeObserver:self]; - [super dealloc]; } @@ -182,7 +160,6 @@ static UICompositeViewDescription *compositeDescription = nil; initWithString:NSLocalizedString(@"Enter an address", @"Enter an address") attributes:@{NSForegroundColorAttributeName: color}]; addressField.attributedPlaceholder = placeHolderString; - [placeHolderString release]; } #endif @@ -312,7 +289,6 @@ static UICompositeViewDescription *compositeDescription = nil; } self.modalPresentationStyle = UIModalPresentationPageSheet; [self.view.window.rootViewController presentViewController:controller animated:TRUE completion:^{}]; - [controller release]; } } else { @@ -322,7 +298,6 @@ static UICompositeViewDescription *compositeDescription = nil; cancelButtonTitle:NSLocalizedString(@"OK", nil) otherButtonTitles: nil]; [alert show]; - [alert release]; } } @@ -354,7 +329,6 @@ static UICompositeViewDescription *compositeDescription = nil; }]; [alertView show]; - [alertView release]; return true; } return false; diff --git a/Classes/FirstLoginViewController.h b/Classes/FirstLoginViewController.h index 44e022547..47894df39 100644 --- a/Classes/FirstLoginViewController.h +++ b/Classes/FirstLoginViewController.h @@ -27,10 +27,10 @@ - (IBAction)onLoginClick:(id)sender; - (IBAction)onSiteClick:(id)sender; -@property (nonatomic, retain) IBOutlet UIButton* loginButton; -@property (nonatomic, retain) IBOutlet UIButton* siteButton; -@property (nonatomic, retain) IBOutlet UITextField* usernameField; -@property (nonatomic, retain) IBOutlet UITextField* passwordField; -@property (nonatomic, retain) IBOutlet UIView* waitView; +@property (nonatomic, strong) IBOutlet UIButton* loginButton; +@property (nonatomic, strong) IBOutlet UIButton* siteButton; +@property (nonatomic, strong) IBOutlet UITextField* usernameField; +@property (nonatomic, strong) IBOutlet UITextField* passwordField; +@property (nonatomic, strong) IBOutlet UIView* waitView; @end diff --git a/Classes/FirstLoginViewController.m b/Classes/FirstLoginViewController.m index cfd5cf754..775601a25 100644 --- a/Classes/FirstLoginViewController.m +++ b/Classes/FirstLoginViewController.m @@ -37,16 +37,10 @@ } - (void)dealloc { - [loginButton release]; - [siteButton release]; - [usernameField release]; - [passwordField release]; - [waitView release]; // Remove all observer [[NSNotificationCenter defaultCenter] removeObserver:self]; - [super dealloc]; } @@ -174,7 +168,6 @@ static UICompositeViewDescription *compositeDescription = nil; cancelButtonTitle:NSLocalizedString(@"Continue",nil) otherButtonTitles:nil]; [error show]; - [error release]; } else { linphone_core_clear_all_auth_info([LinphoneManager getLc]); linphone_core_clear_proxy_config([LinphoneManager getLc]); diff --git a/Classes/HistoryDetailsViewController.h b/Classes/HistoryDetailsViewController.h index 132b1310e..179493aa1 100644 --- a/Classes/HistoryDetailsViewController.h +++ b/Classes/HistoryDetailsViewController.h @@ -29,25 +29,26 @@ LinphoneCallLog *callLog; NSDateFormatter *dateFormatter; } -@property (nonatomic, retain) IBOutlet UIImageView *avatarImage; -@property (nonatomic, retain) IBOutlet UILabel *addressLabel; -@property (nonatomic, retain) IBOutlet UILabel *dateLabel; -@property (nonatomic, retain) IBOutlet UILabel *dateHeaderLabel; -@property (nonatomic, retain) IBOutlet UILabel *durationLabel; -@property (nonatomic, retain) IBOutlet UILabel *durationHeaderLabel; -@property (nonatomic, retain) IBOutlet UILabel *typeLabel; -@property (nonatomic, retain) IBOutlet UILabel *typeHeaderLabel; -@property (nonatomic, retain) IBOutlet UILabel *plainAddressLabel; -@property (nonatomic, retain) IBOutlet UILabel *plainAddressHeaderLabel; -@property (nonatomic, retain) IBOutlet UIButton *callButton; -@property (nonatomic, retain) IBOutlet UIButton *messageButton; -@property (nonatomic, retain) IBOutlet UIButton *addContactButton; -@property (nonatomic, assign) NSString *callLogId; +@property (nonatomic, strong) IBOutlet UIImageView *avatarImage; +@property (nonatomic, strong) IBOutlet UILabel *addressLabel; +@property (nonatomic, strong) IBOutlet UILabel *dateLabel; +@property (nonatomic, strong) IBOutlet UILabel *dateHeaderLabel; +@property (nonatomic, strong) IBOutlet UILabel *durationLabel; +@property (nonatomic, strong) IBOutlet UILabel *durationHeaderLabel; +@property (nonatomic, strong) IBOutlet UILabel *typeLabel; +@property (nonatomic, strong) IBOutlet UILabel *typeHeaderLabel; +@property (nonatomic, strong) IBOutlet UILabel *plainAddressLabel; +@property (nonatomic, strong) IBOutlet UILabel *plainAddressHeaderLabel; +@property (nonatomic, strong) IBOutlet UIButton *callButton; +@property (nonatomic, strong) IBOutlet UIButton *messageButton; +@property (nonatomic, strong) IBOutlet UIButton *addContactButton; +@property (nonatomic, copy, setter=setCallLogId:) NSString *callLogId; - (IBAction)onBackClick:(id)event; - (IBAction)onContactClick:(id)event; - (IBAction)onAddContactClick:(id)event; - (IBAction)onCallClick:(id)event; - (IBAction)onMessageClick:(id)event; +- (void)setCallLogId:(NSString *)acallLogId; @end diff --git a/Classes/HistoryDetailsViewController.m b/Classes/HistoryDetailsViewController.m index d9261bd7c..fd0d0c187 100644 --- a/Classes/HistoryDetailsViewController.m +++ b/Classes/HistoryDetailsViewController.m @@ -22,7 +22,9 @@ #import "FastAddressBook.h" #import "Utils.h" -@implementation HistoryDetailsViewController +@implementation HistoryDetailsViewController { + +} @synthesize callLogId; @synthesize avatarImage; @@ -56,24 +58,8 @@ - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; - [dateFormatter release]; - [callLogId release]; - [avatarImage release]; - [addressLabel release]; - [dateLabel release]; - [dateHeaderLabel release]; - [durationLabel release]; - [durationHeaderLabel release]; - [typeLabel release]; - [typeHeaderLabel release]; - [plainAddressLabel release]; - [plainAddressHeaderLabel release]; - [callButton release]; - [messageButton release]; - [addContactButton release]; - [super dealloc]; } diff --git a/Classes/HistoryTableViewController.m b/Classes/HistoryTableViewController.m index 31b8e9adb..e0121e263 100644 --- a/Classes/HistoryTableViewController.m +++ b/Classes/HistoryTableViewController.m @@ -52,10 +52,6 @@ return self; } -- (void)dealloc { - [callLogs release]; - [super dealloc]; -} #pragma mark - ViewController Functions @@ -138,9 +134,9 @@ static NSString *kCellId = @"UIHistoryCell"; UIHistoryCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellId]; if (cell == nil) { - cell = [[[UIHistoryCell alloc] initWithIdentifier:kCellId] autorelease]; + cell = [[UIHistoryCell alloc] initWithIdentifier:kCellId]; // Background View - UACellBackgroundView *selectedBackgroundView = [[[UACellBackgroundView alloc] initWithFrame:CGRectZero] autorelease]; + UACellBackgroundView *selectedBackgroundView = [[UACellBackgroundView alloc] initWithFrame:CGRectZero]; cell.selectedBackgroundView = selectedBackgroundView; [selectedBackgroundView setBackgroundColor:LINPHONE_TABLE_CELL_BACKGROUND_COLOR]; } diff --git a/Classes/HistoryViewController.h b/Classes/HistoryViewController.h index ad4cb89e3..55d6cc8bf 100644 --- a/Classes/HistoryViewController.h +++ b/Classes/HistoryViewController.h @@ -26,13 +26,13 @@ @interface HistoryViewController : UIViewController { } -@property (nonatomic, retain) IBOutlet HistoryTableViewController* tableController; -@property (nonatomic, retain) IBOutlet UITableView *tableView; +@property (nonatomic, strong) IBOutlet HistoryTableViewController* tableController; +@property (nonatomic, strong) IBOutlet UITableView *tableView; -@property (nonatomic, retain) IBOutlet UIButton* allButton; -@property (nonatomic, retain) IBOutlet UIButton* missedButton; -@property (nonatomic, retain) IBOutlet UIToggleButton* editButton; -@property (nonatomic, retain) IBOutlet UIButton* deleteButton; +@property (nonatomic, strong) IBOutlet UIButton* allButton; +@property (nonatomic, strong) IBOutlet UIButton* missedButton; +@property (nonatomic, strong) IBOutlet UIToggleButton* editButton; +@property (nonatomic, strong) IBOutlet UIButton* deleteButton; - (IBAction)onAllClick:(id) event; - (IBAction)onMissedClick:(id) event; diff --git a/Classes/HistoryViewController.m b/Classes/HistoryViewController.m index 2ae130f4d..54de6cd8f 100644 --- a/Classes/HistoryViewController.m +++ b/Classes/HistoryViewController.m @@ -42,16 +42,6 @@ typedef enum _HistoryView { return [super initWithNibName:@"HistoryViewController" bundle:[NSBundle mainBundle]]; } -- (void)dealloc { - [tableController release]; - [tableView release]; - - [allButton release]; - [missedButton release]; - [editButton release]; - [deleteButton release]; - [super dealloc]; -} #pragma mark - UICompositeViewDelegate Functions diff --git a/Classes/ImagePickerViewController.h b/Classes/ImagePickerViewController.h index a5941ec42..2902fb539 100644 --- a/Classes/ImagePickerViewController.h +++ b/Classes/ImagePickerViewController.h @@ -30,7 +30,7 @@ UIImagePickerController *pickerController; } -@property(nonatomic, retain) id imagePickerDelegate; +@property(nonatomic, strong) id imagePickerDelegate; @property(nonatomic) UIImagePickerControllerSourceType sourceType; @property(nonatomic,copy) NSArray *mediaTypes; @property(nonatomic) BOOL allowsEditing; diff --git a/Classes/ImagePickerViewController.m b/Classes/ImagePickerViewController.m index af021d52d..6c6c95d0d 100644 --- a/Classes/ImagePickerViewController.m +++ b/Classes/ImagePickerViewController.m @@ -44,12 +44,6 @@ return self; } -- (void)dealloc { - [pickerController release]; - [popoverController release]; - - [super dealloc]; -} #pragma mark - UICompositeViewDelegate Functions diff --git a/Classes/ImageSharing.h b/Classes/ImageSharing.h index 1a59c2828..e222e747d 100644 --- a/Classes/ImageSharing.h +++ b/Classes/ImageSharing.h @@ -43,7 +43,7 @@ - (void)cancel; -@property (nonatomic, retain) id userInfo; +@property (nonatomic, strong) id userInfo; @property (nonatomic, readonly) BOOL upload; @property (nonatomic, readonly) NSMutableData* data; diff --git a/Classes/ImageSharing.m b/Classes/ImageSharing.m index 42742a031..6fb88bfd0 100644 --- a/Classes/ImageSharing.m +++ b/Classes/ImageSharing.m @@ -35,7 +35,7 @@ if(imgs != nil) { imgs.userInfo = auserInfo; imgs->upload = TRUE; - imgs->delegate = [delegate retain]; + imgs->delegate = delegate; imgs->data = [[NSMutableData alloc] init]; if(delegate) { [delegate imageSharingProgress:imgs progress:0]; @@ -50,7 +50,7 @@ if(imgs != nil) { imgs.userInfo = auserInfo; imgs->upload = FALSE; - imgs->delegate = [delegate retain]; + imgs->delegate = delegate; imgs->data = [[NSMutableData alloc] init]; if(delegate) { [delegate imageSharingProgress:imgs progress:0]; @@ -60,13 +60,6 @@ return imgs; } -- (void)dealloc { - [connection release]; - [data release]; - [delegate release]; - [userInfo release]; - [super dealloc]; -} #pragma mark - @@ -95,7 +88,7 @@ LOGI(@"downloading [%@]", [url absoluteString]); // setting up the request object now - NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease]; + NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init]; [request setURL:url]; [request setHTTPMethod:@"POST"]; @@ -133,7 +126,6 @@ if(delegate) { [delegate imageSharingError:self error:error]; } - [self release]; } - (void)connection:(NSURLConnection *)connection didSendBodyData:(NSInteger)bytesWritten totalBytesWritten:(NSInteger)totalBytesWritten totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite { @@ -173,7 +165,6 @@ if(delegate) { [delegate imageSharingUploadDone:self url:[NSURL URLWithString:imageRemoteUrl]]; } - [imageRemoteUrl release]; } else { UIImage* image = [UIImage imageWithData:data]; LOGI(@"File downloaded"); @@ -181,7 +172,6 @@ [delegate imageSharingDownloadDone:self image:image]; } } - [self release]; } @end diff --git a/Classes/ImageViewController.h b/Classes/ImageViewController.h index 69e04bb27..c0de9560f 100644 --- a/Classes/ImageViewController.h +++ b/Classes/ImageViewController.h @@ -23,7 +23,7 @@ @interface UIImageScrollView : UIScrollView -@property (nonatomic, retain) UIImage *image; +@property (nonatomic, strong) UIImage *image; @property (readonly) IBOutlet UIImageView *imageView; @end @@ -32,9 +32,9 @@ } -@property (nonatomic, retain) IBOutlet UIImageScrollView *scrollView; -@property (nonatomic, retain) UIImage *image; -@property (nonatomic, retain) IBOutlet UIButton *backButton; +@property (nonatomic, strong) IBOutlet UIImageScrollView *scrollView; +@property (nonatomic, strong) UIImage *image; +@property (nonatomic, strong) IBOutlet UIButton *backButton; - (IBAction)onBackClick:(id)sender; diff --git a/Classes/ImageViewController.m b/Classes/ImageViewController.m index 1f37808bd..22f6585cb 100644 --- a/Classes/ImageViewController.m +++ b/Classes/ImageViewController.m @@ -58,12 +58,6 @@ return self; } -- (void)dealloc { - [image release]; - [imageView dealloc]; - - [super dealloc]; -} #pragma mark - ViewController Functions @@ -132,12 +126,6 @@ return [super initWithNibName:@"ImageViewController" bundle:[NSBundle mainBundle]]; } -- (void)dealloc { - [scrollView release]; - [backButton release]; - - [super dealloc]; -} #pragma mark - UICompositeViewDelegate Functions diff --git a/Classes/InAppProductsCell.h b/Classes/InAppProductsCell.h index 87cf2a739..4efa640ee 100644 --- a/Classes/InAppProductsCell.h +++ b/Classes/InAppProductsCell.h @@ -11,12 +11,12 @@ @interface InAppProductsCell : UITableViewCell { } -@property (retain, nonatomic) IBOutlet UILabel *ptitle; -@property (retain, nonatomic) IBOutlet UILabel *pdescription; -@property (retain, nonatomic) IBOutlet UILabel *pprice; -@property (retain, nonatomic) IBOutlet UISwitch *ppurchased; +@property (strong, nonatomic) IBOutlet UILabel *ptitle; +@property (strong, nonatomic) IBOutlet UILabel *pdescription; +@property (strong, nonatomic) IBOutlet UILabel *pprice; +@property (strong, nonatomic) IBOutlet UISwitch *ppurchased; @property (nonatomic) BOOL isMaximized; -@property (retain, nonatomic) NSString *productID; +@property (strong, nonatomic) NSString *productID; - (id)initWithIdentifier:(NSString*)identifier maximized:(bool)maximized; diff --git a/Classes/InAppProductsCell.m b/Classes/InAppProductsCell.m index 6062261d6..e0e8ea763 100644 --- a/Classes/InAppProductsCell.m +++ b/Classes/InAppProductsCell.m @@ -48,13 +48,6 @@ return self; } -- (void)dealloc { - [_ptitle release]; - [_pdescription release]; - [_pprice release]; - [_ppurchased release]; - [super dealloc]; -} - (NSString *)description { return [NSString stringWithFormat:@"%@ (%@): %@ (%@)", _ptitle.text, _pprice.text, _pdescription.text, _isMaximized ? @"maximized":@"minimized"]; diff --git a/Classes/InAppProductsManager.h b/Classes/InAppProductsManager.h index f23a9cdeb..b37362b03 100644 --- a/Classes/InAppProductsManager.h +++ b/Classes/InAppProductsManager.h @@ -60,7 +60,7 @@ typedef NSString* IAPPurchaseNotificationStatus; } -@property (nonatomic, retain) IAPPurchaseNotificationStatus status; +@property (nonatomic, strong) IAPPurchaseNotificationStatus status; @property (nonatomic, strong) NSMutableArray *productsAvailable; @property (nonatomic, strong) NSMutableArray *productsIDPurchased; diff --git a/Classes/InAppProductsManager.m b/Classes/InAppProductsManager.m index a9c35d7ac..343624781 100644 --- a/Classes/InAppProductsManager.m +++ b/Classes/InAppProductsManager.m @@ -32,10 +32,10 @@ #import "InAppProductsViewController.h" @interface InAppProductsManager() -@property (retain, nonatomic) NSDate *expirationDate; -@property (retain, nonatomic) NSDictionary *accountCreationData; +@property (strong, nonatomic) NSDate *expirationDate; +@property (strong, nonatomic) NSDictionary *accountCreationData; // needed because request:didFailWithError method is already used by SKProductsRequestDelegate... -@property (nonatomic, retain) InAppProductsXMLRPCDelegate *xmlrpc; +@property (nonatomic, strong) InAppProductsXMLRPCDelegate *xmlrpc; @end @implementation InAppProductsManager diff --git a/Classes/InAppProductsTableViewController.m b/Classes/InAppProductsTableViewController.m index 53957831c..6c5232283 100644 --- a/Classes/InAppProductsTableViewController.m +++ b/Classes/InAppProductsTableViewController.m @@ -36,7 +36,7 @@ static NSString *kCellId = @"InAppProductsCell"; InAppProductsCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellId]; if (cell == nil) { - cell = [[[InAppProductsCell alloc] initWithIdentifier:kCellId maximized:(currentExpanded == indexPath.row)] autorelease]; + cell = [[InAppProductsCell alloc] initWithIdentifier:kCellId maximized:(currentExpanded == indexPath.row)]; } SKProduct *prod = [[[[LinphoneManager instance] iapManager] productsAvailable] objectAtIndex:indexPath.row]; [cell fillFromProduct:prod]; @@ -65,7 +65,6 @@ [alert addCancelButtonWithTitle:NSLocalizedString(@"OK", nil) block:nil]; [alert show]; - [alert release]; } else { //try to purchase item, and if successfull change the switch [[[LinphoneManager instance] iapManager] purchaseWitID: cell.productID]; diff --git a/Classes/InAppProductsViewController.h b/Classes/InAppProductsViewController.h index 52eefd803..84ad3469d 100644 --- a/Classes/InAppProductsViewController.h +++ b/Classes/InAppProductsViewController.h @@ -13,8 +13,8 @@ @interface InAppProductsViewController : UIViewController { } -@property (nonatomic, retain) IBOutlet InAppProductsTableViewController* tableController; -@property (retain, nonatomic) IBOutlet UIView *waitView; +@property (nonatomic, strong) IBOutlet InAppProductsTableViewController* tableController; +@property (strong, nonatomic) IBOutlet UIView *waitView; - (IBAction)onRestoreClicked:(UIButton *)sender; @end diff --git a/Classes/InAppProductsViewController.m b/Classes/InAppProductsViewController.m index 01bffdba3..2154a82b0 100644 --- a/Classes/InAppProductsViewController.m +++ b/Classes/InAppProductsViewController.m @@ -21,10 +21,7 @@ - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; - [_tableController release]; - [_waitView release]; - [super dealloc]; } #pragma mark - ViewController Functions diff --git a/Classes/InCallTableViewController.m b/Classes/InCallTableViewController.m index 6993a3cb0..5bebe177c 100644 --- a/Classes/InCallTableViewController.m +++ b/Classes/InCallTableViewController.m @@ -62,9 +62,6 @@ enum TableSection { return self; } -- (void)dealloc { - [super dealloc]; -} #pragma mark - ViewController Functions @@ -133,7 +130,7 @@ enum TableSection { - (void)removeCallData:(LinphoneCall*) call { // Remove data associated with the call if(call != NULL) { - LinphoneCallAppData* appData = (LinphoneCallAppData*) linphone_call_get_user_pointer(call); + LinphoneCallAppData* appData = (__bridge LinphoneCallAppData*) linphone_call_get_user_pointer(call); if(appData != NULL) { [appData->userInfos removeObjectForKey:kLinphoneInCallCellData]; } @@ -144,11 +141,11 @@ enum TableSection { // Handle data associated with the call UICallCellData * data = nil; if(call != NULL) { - LinphoneCallAppData* appData = (LinphoneCallAppData*) linphone_call_get_user_pointer(call); + LinphoneCallAppData* appData = (__bridge LinphoneCallAppData*) linphone_call_get_user_pointer(call); if(appData != NULL) { data = [appData->userInfos objectForKey:kLinphoneInCallCellData]; if(data == nil) { - data = [[[UICallCellData alloc] init:call minimized:minimized] autorelease]; + data = [[UICallCellData alloc] init:call minimized:minimized]; [appData->userInfos setObject:data forKey:kLinphoneInCallCellData]; } } @@ -160,7 +157,7 @@ enum TableSection { // Handle data associated with the call UICallCellData * data = nil; if(call != NULL) { - LinphoneCallAppData* appData = (LinphoneCallAppData*) linphone_call_get_user_pointer(call); + LinphoneCallAppData* appData = (__bridge LinphoneCallAppData*) linphone_call_get_user_pointer(call); if(appData != NULL) { data = [appData->userInfos objectForKey:kLinphoneInCallCellData]; } @@ -214,7 +211,7 @@ enum TableSection { static NSString *kCellId = @"UICallCell"; UICallCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellId]; if (cell == nil) { - cell = [[[UICallCell alloc] initWithIdentifier:kCellId] autorelease]; + cell = [[UICallCell alloc] initWithIdentifier:kCellId]; } bool inConference = indexPath.section == ConferenceSection; @@ -275,24 +272,23 @@ enum TableSection { - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { if(section == CallSection) { - return [[[UIView alloc] initWithFrame:CGRectZero] autorelease]; + return [[UIView alloc] initWithFrame:CGRectZero]; } else if(section == ConferenceSection) { LinphoneCore* lc = [LinphoneManager getLc]; if(linphone_core_get_conference_size(lc) > 0){ UIConferenceHeader *headerController = [[UIConferenceHeader alloc] init]; [headerController update]; UIView *headerView = [headerController view]; - [headerController release]; return headerView; } else { - return [[[UIView alloc] initWithFrame:CGRectZero] autorelease]; + return [[UIView alloc] initWithFrame:CGRectZero]; } } - return [[[UIView alloc] initWithFrame:CGRectZero] autorelease]; + return [[UIView alloc] initWithFrame:CGRectZero]; } - (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section { - return [[[UIView alloc] initWithFrame:CGRectZero] autorelease]; + return [[UIView alloc] initWithFrame:CGRectZero]; } - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { diff --git a/Classes/InCallViewController.h b/Classes/InCallViewController.h index d349c9ea8..d22923990 100644 --- a/Classes/InCallViewController.h +++ b/Classes/InCallViewController.h @@ -35,16 +35,16 @@ VideoZoomHandler* videoZoomHandler; } -@property (nonatomic, retain) IBOutlet InCallTableViewController* callTableController; -@property (nonatomic, retain) IBOutlet UITableView* callTableView; +@property (nonatomic, strong) IBOutlet InCallTableViewController* callTableController; +@property (nonatomic, strong) IBOutlet UITableView* callTableView; -@property (nonatomic, retain) IBOutlet UIView* videoGroup; -@property (nonatomic, retain) IBOutlet UIView* videoView; +@property (nonatomic, strong) IBOutlet UIView* videoGroup; +@property (nonatomic, strong) IBOutlet UIView* videoView; #ifdef TEST_VIDEO_VIEW_CHANGE @property (nonatomic, retain) IBOutlet UIView* testVideoView; #endif -@property (nonatomic, retain) IBOutlet UIView* videoPreview; -@property (nonatomic, retain) IBOutlet UICamSwitch* videoCameraSwitch; -@property (nonatomic, retain) IBOutlet UIActivityIndicatorView* videoWaitingForFirstImage; +@property (nonatomic, strong) IBOutlet UIView* videoPreview; +@property (nonatomic, strong) IBOutlet UICamSwitch* videoCameraSwitch; +@property (nonatomic, strong) IBOutlet UIActivityIndicatorView* videoWaitingForFirstImage; @end diff --git a/Classes/InCallViewController.m b/Classes/InCallViewController.m index f87171408..06656d295 100644 --- a/Classes/InCallViewController.m +++ b/Classes/InCallViewController.m @@ -65,28 +65,18 @@ const NSInteger SECURE_BUTTON_TAG=5; } - (void)dealloc { - [callTableController release]; - [callTableView release]; - [videoGroup release]; - [videoView release]; - [videoPreview release]; #ifdef TEST_VIDEO_VIEW_CHANGE [testVideoView release]; #endif - [videoCameraSwitch release]; - [videoWaitingForFirstImage release]; - [videoZoomHandler release]; [[PhoneMainView instance].view removeGestureRecognizer:singleFingerTap]; - [singleFingerTap release]; // Remove all observer [[NSNotificationCenter defaultCenter] removeObserver:self]; - [super dealloc]; } @@ -237,7 +227,7 @@ static UICompositeViewDescription *compositeDescription = nil; } else { [self displayTableCall:animated]; const LinphoneCallParams* param = linphone_call_get_current_params(call); - const LinphoneCallAppData* callAppData = linphone_call_get_user_pointer(call); + const LinphoneCallAppData* callAppData = (__bridge const LinphoneCallAppData *)(linphone_call_get_user_pointer(call)); if(state == LinphoneCallStreamsRunning && callAppData->videoRequested && linphone_call_params_low_bandwidth_enabled(param)) { @@ -248,7 +238,6 @@ static UICompositeViewDescription *compositeDescription = nil; cancelButtonTitle:NSLocalizedString(@"Continue", nil) otherButtonTitles:nil]; [alert show]; - [alert release]; callAppData->videoRequested=FALSE; /*reset field*/ } } @@ -400,7 +389,7 @@ static UICompositeViewDescription *compositeDescription = nil; LinphoneCall *call = linphone_core_get_current_call([LinphoneManager getLc]); //linphone_call_params_get_used_video_codec return 0 if no video stream enabled if (call != NULL && linphone_call_params_get_used_video_codec(linphone_call_get_current_params(call))) { - linphone_call_set_next_video_frame_decoded_callback(call, hideSpinner, self); + linphone_call_set_next_video_frame_decoded_callback(call, hideSpinner, (__bridge void *)(self)); } } @@ -456,7 +445,7 @@ static UICompositeViewDescription *compositeDescription = nil; } static void hideSpinner(LinphoneCall* call, void* user_data) { - InCallViewController* thiz = (InCallViewController*) user_data; + InCallViewController* thiz = (__bridge InCallViewController*) user_data; [thiz hideSpinnerIndicator:call]; } @@ -477,12 +466,12 @@ static void hideSpinner(LinphoneCall* call, void* user_data) { return; const char* lUserNameChars = linphone_address_get_username(linphone_call_get_remote_address(call)); - NSString* lUserName = lUserNameChars?[[[NSString alloc] initWithUTF8String:lUserNameChars] autorelease]:NSLocalizedString(@"Unknown",nil); + NSString* lUserName = lUserNameChars?[[NSString alloc] initWithUTF8String:lUserNameChars]:NSLocalizedString(@"Unknown",nil); const char* lDisplayNameChars = linphone_address_get_display_name(linphone_call_get_remote_address(call)); - NSString* lDisplayName = [lDisplayNameChars?[[NSString alloc] initWithUTF8String:lDisplayNameChars]:@"" autorelease]; + NSString* lDisplayName = lDisplayNameChars?[[NSString alloc] initWithUTF8String:lDisplayNameChars]:@""; NSString* title = [NSString stringWithFormat : NSLocalizedString(@"'%@' would like to enable video",nil), ([lDisplayName length] > 0)?lDisplayName:lUserName]; - DTActionSheet *sheet = [[[DTActionSheet alloc] initWithTitle:title] autorelease]; + DTActionSheet *sheet = [[DTActionSheet alloc] initWithTitle:title]; NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:30 target:self selector:@selector(dismissVideoActionSheet:) userInfo:sheet repeats:NO]; [sheet addButtonWithTitle:NSLocalizedString(@"Accept", nil) block:^() { LOGI(@"User accept video proposal"); diff --git a/Classes/IncomingCallViewController.h b/Classes/IncomingCallViewController.h index 269c87a24..0eadd3734 100644 --- a/Classes/IncomingCallViewController.h +++ b/Classes/IncomingCallViewController.h @@ -34,10 +34,10 @@ @interface IncomingCallViewController : TPMultiLayoutViewController { } -@property (nonatomic, retain) IBOutlet UILabel* addressLabel; -@property (nonatomic, retain) IBOutlet UIImageView* avatarImage; +@property (nonatomic, strong) IBOutlet UILabel* addressLabel; +@property (nonatomic, strong) IBOutlet UIImageView* avatarImage; @property (nonatomic, assign) LinphoneCall* call; -@property (nonatomic, retain) id delegate; +@property (nonatomic, strong) id delegate; - (IBAction)onAcceptClick:(id) event; - (IBAction)onDeclineClick:(id) event; diff --git a/Classes/IncomingCallViewController.m b/Classes/IncomingCallViewController.m index 5c7519c92..f91f5d22b 100644 --- a/Classes/IncomingCallViewController.m +++ b/Classes/IncomingCallViewController.m @@ -39,10 +39,6 @@ - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; - [avatarImage release]; - [addressLabel release]; - [delegate release]; - [super dealloc]; } diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m index 2de8447c0..8422b6a5b 100644 --- a/Classes/LinphoneAppDelegate.m +++ b/Classes/LinphoneAppDelegate.m @@ -44,9 +44,6 @@ return self; } -- (void)dealloc { - [super dealloc]; -} #pragma mark - @@ -116,14 +113,14 @@ - (UIUserNotificationCategory*)getMessageNotificationCategory { - UIMutableUserNotificationAction* reply = [[[UIMutableUserNotificationAction alloc] init] autorelease]; + UIMutableUserNotificationAction* reply = [[UIMutableUserNotificationAction alloc] init]; reply.identifier = @"reply"; reply.title = NSLocalizedString(@"Reply", nil); reply.activationMode = UIUserNotificationActivationModeForeground; reply.destructive = NO; reply.authenticationRequired = YES; - UIMutableUserNotificationAction* mark_read = [[[UIMutableUserNotificationAction alloc] init] autorelease]; + UIMutableUserNotificationAction* mark_read = [[UIMutableUserNotificationAction alloc] init]; mark_read.identifier = @"mark_read"; mark_read.title = NSLocalizedString(@"Mark Read", nil); mark_read.activationMode = UIUserNotificationActivationModeBackground; @@ -132,7 +129,7 @@ NSArray* localRingActions = @[mark_read, reply]; - UIMutableUserNotificationCategory* localRingNotifAction = [[[UIMutableUserNotificationCategory alloc] init] autorelease]; + UIMutableUserNotificationCategory* localRingNotifAction = [[UIMutableUserNotificationCategory alloc] init]; localRingNotifAction.identifier = @"incoming_msg"; [localRingNotifAction setActions:localRingActions forContext:UIUserNotificationActionContextDefault]; [localRingNotifAction setActions:localRingActions forContext:UIUserNotificationActionContextMinimal]; @@ -141,14 +138,14 @@ } - (UIUserNotificationCategory*)getCallNotificationCategory { - UIMutableUserNotificationAction* answer = [[[UIMutableUserNotificationAction alloc] init] autorelease]; + UIMutableUserNotificationAction* answer = [[UIMutableUserNotificationAction alloc] init]; answer.identifier = @"answer"; answer.title = NSLocalizedString(@"Answer", nil); answer.activationMode = UIUserNotificationActivationModeForeground; answer.destructive = NO; answer.authenticationRequired = YES; - UIMutableUserNotificationAction* decline = [[[UIMutableUserNotificationAction alloc] init] autorelease]; + UIMutableUserNotificationAction* decline = [[UIMutableUserNotificationAction alloc] init]; decline.identifier = @"decline"; decline.title = NSLocalizedString(@"Decline", nil); decline.activationMode = UIUserNotificationActivationModeBackground; @@ -158,7 +155,7 @@ NSArray* localRingActions = @[decline, answer]; - UIMutableUserNotificationCategory* localRingNotifAction = [[[UIMutableUserNotificationCategory alloc] init] autorelease]; + UIMutableUserNotificationCategory* localRingNotifAction = [[UIMutableUserNotificationCategory alloc] init]; localRingNotifAction.identifier = @"incoming_call"; [localRingNotifAction setActions:localRingActions forContext:UIUserNotificationActionContextDefault]; [localRingNotifAction setActions:localRingActions forContext:UIUserNotificationActionContextMinimal]; @@ -247,7 +244,6 @@ otherButtonTitles:NSLocalizedString(@"Yes",nil),nil]; confirmation.tag = 1; [confirmation show]; - [confirmation release]; } else { if([[url scheme] isEqualToString:@"sip"]) { // remove "sip://" from the URI, and do it correctly by taking resourceSpecifier and removing leading and trailing "/" @@ -462,7 +458,6 @@ cancelButtonTitle:NSLocalizedString(@"OK",nil) otherButtonTitles:nil]; [error show]; - [error release]; [[PhoneMainView instance] startUp]; } if (state == LinphoneConfiguringFailed) { @@ -476,7 +471,6 @@ cancelButtonTitle:NSLocalizedString(@"OK",nil) otherButtonTitles:nil]; [error show]; - [error release]; } } @@ -492,7 +486,6 @@ [_waitingIndicator addSubview:progress]; } [progress startAnimating]; - [progress release]; [_waitingIndicator show]; } diff --git a/Classes/LinphoneCoreSettingsStore.m b/Classes/LinphoneCoreSettingsStore.m index 0f438ce9f..191972865 100644 --- a/Classes/LinphoneCoreSettingsStore.m +++ b/Classes/LinphoneCoreSettingsStore.m @@ -35,11 +35,6 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args); return self; } -- (void)dealloc { - [dict release]; - [changedDict release]; - [super dealloc]; -} - (void)transformKeysToLinphoneCore { //LinphoneCore *lc=[LinphoneManager getLc]; @@ -50,7 +45,6 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args); id obj=Nil; if (value) obj=[[NSString alloc] initWithCString:value encoding:[NSString defaultCStringEncoding] ]; [self setObject:obj forKey:key]; - [obj release]; } - (NSString*)stringForKey:(NSString*) key { @@ -262,7 +256,6 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args); } } - [changedDict release]; changedDict = [[NSMutableDictionary alloc] init]; // Post event @@ -290,7 +283,6 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args); cancelButtonTitle:NSLocalizedString(@"OK", nil) otherButtonTitles: nil]; [alertview show]; - [alertview release]; } + (BOOL)hasSipPrefix:(NSString*)str { @@ -739,7 +731,6 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args); [[LinphoneManager instance] setTunnelMode:mode]; } - [changedDict release]; changedDict = [[NSMutableDictionary alloc] init]; // Post event diff --git a/Classes/LinphoneManager.h b/Classes/LinphoneManager.h index 5f17ffdb1..7daa5e605 100644 --- a/Classes/LinphoneManager.h +++ b/Classes/LinphoneManager.h @@ -122,7 +122,6 @@ typedef struct _LinphoneManagerSounds { + (void)instanceRelease; #endif + (LinphoneCore*) getLc; -+ (BOOL)isLcReady; + (BOOL)runningOnIpad; + (BOOL)isNotIphone3G; + (NSString *)getPreferenceForCodec: (const char*) name withRate: (int) rate; @@ -183,14 +182,14 @@ typedef struct _LinphoneManagerSounds { - (void)silentPushFailed:(NSTimer*)timer; @property (readonly) BOOL isTesting; -@property (readonly) FastAddressBook* fastAddressBook; +@property (readonly, strong) FastAddressBook* fastAddressBook; @property Connectivity connectivity; @property (readonly) NetworkType network; @property (readonly) const char* frontCamId; @property (readonly) const char* backCamId; -@property (retain, nonatomic) NSString* SSID; +@property (strong, nonatomic) NSString* SSID; @property (readonly) sqlite3* database; -@property (nonatomic, retain) NSData *pushNotificationToken; +@property (nonatomic, strong) NSData *pushNotificationToken; @property (readonly) LinphoneManagerSounds sounds; @property (readonly) NSMutableArray *logs; @property (nonatomic, assign) BOOL speakerEnabled; diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index eaadf8ea1..fe5ba7f4b 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -97,15 +97,11 @@ NSString *const kLinphoneInternalChatDBFilename = @"linphone_chats.db"; return self; } -- (void)dealloc { - [self->userInfos release]; - [super dealloc]; -} @end @interface LinphoneManager () -@property (retain, nonatomic) AVAudioPlayer* messagePlayer; +@property (strong, nonatomic) AVAudioPlayer* messagePlayer; @end @implementation LinphoneManager @@ -131,30 +127,30 @@ NSString *const kLinphoneInternalChatDBFilename = @"linphone_chats.db"; struct codec_name_pref_table{ const char *name; int rate; - NSString *prefname; + const char *prefname; }; struct codec_name_pref_table codec_pref_table[]={ - { "speex", 8000, @"speex_8k_preference" }, - { "speex", 16000, @"speex_16k_preference" }, - { "silk", 24000, @"silk_24k_preference" }, - { "silk", 16000, @"silk_16k_preference" }, - { "amr", 8000, @"amr_preference" }, - { "gsm", 8000, @"gsm_preference" }, - { "ilbc", 8000, @"ilbc_preference"}, - { "pcmu", 8000, @"pcmu_preference"}, - { "pcma", 8000, @"pcma_preference"}, - { "g722", 8000, @"g722_preference"}, - { "g729", 8000, @"g729_preference"}, - { "mp4v-es", 90000, @"mp4v-es_preference"}, - { "h264", 90000, @"h264_preference"}, - { "vp8", 90000, @"vp8_preference"}, - { "mpeg4-generic", 16000, @"aaceld_16k_preference"}, - { "mpeg4-generic", 22050, @"aaceld_22k_preference"}, - { "mpeg4-generic", 32000, @"aaceld_32k_preference"}, - { "mpeg4-generic", 44100, @"aaceld_44k_preference"}, - { "mpeg4-generic", 48000, @"aaceld_48k_preference"}, - { "opus", 48000, @"opus_preference"}, + { "speex", 8000, "speex_8k_preference" }, + { "speex", 16000, "speex_16k_preference" }, + { "silk", 24000, "silk_24k_preference" }, + { "silk", 16000, "silk_16k_preference" }, + { "amr", 8000, "amr_preference" }, + { "gsm", 8000, "gsm_preference" }, + { "ilbc", 8000, "ilbc_preference"}, + { "pcmu", 8000, "pcmu_preference"}, + { "pcma", 8000, "pcma_preference"}, + { "g722", 8000, "g722_preference"}, + { "g729", 8000, "g729_preference"}, + { "mp4v-es", 90000, "mp4v-es_preference"}, + { "h264", 90000, "h264_preference"}, + { "vp8", 90000, "vp8_preference"}, + { "mpeg4-generic", 16000, "aaceld_16k_preference"}, + { "mpeg4-generic", 22050, "aaceld_22k_preference"}, + { "mpeg4-generic", 32000, "aaceld_32k_preference"}, + { "mpeg4-generic", 44100, "aaceld_44k_preference"}, + { "mpeg4-generic", 48000, "aaceld_48k_preference"}, + { "opus", 48000, "opus_preference"}, { NULL,0,Nil } }; @@ -162,7 +158,7 @@ struct codec_name_pref_table codec_pref_table[]={ int i; for(i=0;codec_pref_table[i].name!=NULL;++i){ if (strcasecmp(codec_pref_table[i].name,name)==0 && codec_pref_table[i].rate==rate) - return codec_pref_table[i].prefname; + return [NSString stringWithUTF8String:codec_pref_table[i].prefname]; } return Nil; } @@ -176,11 +172,11 @@ struct codec_name_pref_table codec_pref_table[]={ LINPHONE_FIND_PAYLOAD_IGNORE_CHANNELS); if( (available == NULL) // these two codecs should not be hidden, even if not supported - && ![codec_pref_table[i].prefname isEqualToString:@"h264_preference"] - && ![codec_pref_table[i].prefname isEqualToString:@"mp4v-es_preference"] + && strcmp(codec_pref_table[i].prefname, "h264_preference") != 0 + && strcmp(codec_pref_table[i].prefname, "mp4v-es_preference") != 0 ) { - [set addObject:codec_pref_table[i].prefname]; + [set addObject:[NSString stringWithUTF8String:codec_pref_table[i].prefname]]; } } return set; @@ -217,7 +213,6 @@ struct codec_name_pref_table codec_pref_table[]={ result = ![platform isEqualToString:@"iPhone1,2"]; - [platform release]; done=TRUE; } return result; @@ -232,9 +227,10 @@ struct codec_name_pref_table codec_pref_table[]={ } + (LinphoneManager*)instance { - if(theLinphoneManager == nil) { - theLinphoneManager = [LinphoneManager alloc]; - [theLinphoneManager init]; + @synchronized(self){ + if(theLinphoneManager == nil) { + theLinphoneManager = [[LinphoneManager alloc] init]; + } } return theLinphoneManager; } @@ -242,7 +238,6 @@ struct codec_name_pref_table codec_pref_table[]={ #ifdef DEBUG + (void)instanceRelease { if(theLinphoneManager != nil) { - [theLinphoneManager release]; theLinphoneManager = nil; } } @@ -262,13 +257,13 @@ struct codec_name_pref_table codec_pref_table[]={ - (id)init { if ((self = [super init])) { AudioSessionInitialize(NULL, NULL, NULL, NULL); - OSStatus lStatus = AudioSessionAddPropertyListener(kAudioSessionProperty_AudioRouteChange, audioRouteChangeListenerCallback, self); + OSStatus lStatus = AudioSessionAddPropertyListener(kAudioSessionProperty_AudioRouteChange, audioRouteChangeListenerCallback, (__bridge void *)(self)); if (lStatus) { LOGE(@"cannot register route change handler [%ld]",lStatus); } NSString *path = [[NSBundle mainBundle] pathForResource:@"msg" ofType:@"wav"]; - self.messagePlayer = [[[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL URLWithString:path] error:nil] autorelease]; + self.messagePlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL URLWithString:path] error:nil]; sounds.vibrate = kSystemSoundID_Vibrate; @@ -301,10 +296,8 @@ struct codec_name_pref_table codec_pref_table[]={ } - (void)dealloc { - [fastAddressBook release]; - [logs release]; - OSStatus lStatus = AudioSessionRemovePropertyListenerWithUserData(kAudioSessionProperty_AudioRouteChange, audioRouteChangeListenerCallback, self); + OSStatus lStatus = AudioSessionRemovePropertyListenerWithUserData(kAudioSessionProperty_AudioRouteChange, audioRouteChangeListenerCallback, (__bridge void *)(self)); if (lStatus) { LOGE(@"cannot un register route change handler [%ld]", lStatus); } @@ -313,9 +306,6 @@ struct codec_name_pref_table codec_pref_table[]={ [[NSNotificationCenter defaultCenter] removeObserver:self forKeyPath:kLinphoneConfiguringStateUpdate]; - [photoLibrary release]; - [pushCallIDs release]; - [super dealloc]; } - (void)silentPushFailed:(NSTimer*)timer @@ -504,9 +494,6 @@ exit_dbmigration: return theLinphoneCore; } -+ (BOOL)isLcReady { - return theLinphoneCore != nil; -} #pragma mark Debug functions @@ -555,7 +542,6 @@ void linphone_iphone_log_handler(int lev, const char *fmt, va_list args){ // }); // // [formatedString release]; - [format release]; } //Error/warning log handler @@ -588,8 +574,7 @@ static void linphone_iphone_log(struct _LinphoneCore * lc, const char * message) static void linphone_iphone_display_status(struct _LinphoneCore * lc, const char * message) { NSString* status = [[NSString alloc] initWithCString:message encoding:[NSString defaultCStringEncoding]]; - [(LinphoneManager*)linphone_core_get_user_data(lc) displayStatus:status]; - [status release]; + [(__bridge LinphoneManager*)linphone_core_get_user_data(lc) displayStatus:status]; } @@ -607,10 +592,10 @@ static void linphone_iphone_display_status(struct _LinphoneCore * lc, const char - (void)onCall:(LinphoneCall*)call StateChanged:(LinphoneCallState)state withMessage:(const char *)message { // Handling wrapper - LinphoneCallAppData* data=(LinphoneCallAppData*)linphone_call_get_user_pointer(call); + LinphoneCallAppData* data=(__bridge LinphoneCallAppData*)linphone_call_get_user_data(call); if (!data) { data = [[LinphoneCallAppData alloc] init]; - linphone_call_set_user_pointer(call, data); + linphone_call_set_user_data(call, (__bridge_retained void*)data); } if (silentPushCompletion) { @@ -663,10 +648,8 @@ static void linphone_iphone_display_status(struct _LinphoneCore * lc, const char ms_free(tmp); } linphone_core_decline_call(theLinphoneCore, call,LinphoneReasonBusy); - [lCTCallCenter release]; return; } - [lCTCallCenter release]; if( [UIApplication sharedApplication].applicationState == UIApplicationStateBackground) { @@ -743,7 +726,6 @@ static void linphone_iphone_display_status(struct _LinphoneCore * lc, const char } [[UIApplication sharedApplication] cancelLocalNotification:data->notification]; - [data->notification release]; data->notification = nil; if(log == NULL || linphone_call_log_get_status(log) == LinphoneCallMissed) { @@ -753,7 +735,6 @@ static void linphone_iphone_display_status(struct _LinphoneCore * lc, const char notification.alertAction = NSLocalizedString(@"Show", nil); notification.userInfo = [NSDictionary dictionaryWithObject:[NSString stringWithUTF8String:linphone_call_log_get_call_id(log)] forKey:@"callLog"]; [[UIApplication sharedApplication] presentLocalNotificationNow:notification]; - [notification release]; } } @@ -761,8 +742,8 @@ static void linphone_iphone_display_status(struct _LinphoneCore * lc, const char if(state == LinphoneCallReleased) { if(data != NULL) { - [data release]; - linphone_call_set_user_pointer(call, NULL); + linphone_call_set_user_data(call, NULL); + CFBridgingRelease((__bridge CFTypeRef)(data)); } } @@ -789,7 +770,7 @@ static void linphone_iphone_display_status(struct _LinphoneCore * lc, const char } static void linphone_iphone_call_state(LinphoneCore *lc, LinphoneCall* call, LinphoneCallState state,const char* message) { - [(LinphoneManager*)linphone_core_get_user_data(lc) onCall:call StateChanged: state withMessage: message]; + [(__bridge LinphoneManager*)linphone_core_get_user_data(lc) onCall:call StateChanged: state withMessage: message]; } @@ -801,7 +782,7 @@ static void linphone_iphone_transfer_state_changed(LinphoneCore* lc, LinphoneCal #pragma mark - Global state change static void linphone_iphone_global_state_changed(LinphoneCore *lc, LinphoneGlobalState gstate, const char *message) { - [(LinphoneManager*)linphone_core_get_user_data(lc) onGlobalStateChanged:gstate withMessage:message]; + [(__bridge LinphoneManager*)linphone_core_get_user_data(lc) onGlobalStateChanged:gstate withMessage:message]; } -(void)onGlobalStateChanged:(LinphoneGlobalState)state withMessage:(const char*)message { @@ -829,7 +810,7 @@ static void linphone_iphone_global_state_changed(LinphoneCore *lc, LinphoneGloba #pragma mark - Configuring status changed static void linphone_iphone_configuring_status_changed(LinphoneCore *lc, LinphoneConfiguringState status, const char *message) { - [(LinphoneManager*)linphone_core_get_user_data(lc) onConfiguringStatusChanged:status withMessage:message]; + [(__bridge LinphoneManager*)linphone_core_get_user_data(lc) onConfiguringStatusChanged:status withMessage:message]; } -(void)onConfiguringStatusChanged:(LinphoneConfiguringState)status withMessage:(const char*)message { @@ -871,7 +852,7 @@ static void linphone_iphone_configuring_status_changed(LinphoneCore *lc, Linphon } static void linphone_iphone_registration_state(LinphoneCore *lc, LinphoneProxyConfig* cfg, LinphoneRegistrationState state,const char* message) { - [(LinphoneManager*)linphone_core_get_user_data(lc) onRegister:lc cfg:cfg state:state message:message]; + [(__bridge LinphoneManager*)linphone_core_get_user_data(lc) onRegister:lc cfg:cfg state:state message:message]; } @@ -913,7 +894,7 @@ static void linphone_iphone_registration_state(LinphoneCore *lc, LinphoneProxyCo } // Create a new notification - UILocalNotification* notif = [[[UILocalNotification alloc] init] autorelease]; + UILocalNotification* notif = [[UILocalNotification alloc] init]; if (notif) { notif.repeatInterval = 0; if( [[UIDevice currentDevice].systemVersion floatValue] >= 8){ @@ -938,7 +919,7 @@ static void linphone_iphone_registration_state(LinphoneCore *lc, LinphoneProxyCo } static void linphone_iphone_message_received(LinphoneCore *lc, LinphoneChatRoom *room, LinphoneChatMessage *message) { - [(LinphoneManager*)linphone_core_get_user_data(lc) onMessageReceived:lc room:room message:message]; + [(__bridge LinphoneManager*)linphone_core_get_user_data(lc) onMessageReceived:lc room:room message:message]; } - (void)onNotifyReceived:(LinphoneCore *)lc event:(LinphoneEvent *)lev notifyEvent:(const char *)notified_event content:(const LinphoneContent *)body { @@ -954,7 +935,7 @@ static void linphone_iphone_message_received(LinphoneCore *lc, LinphoneChatRoom } static void linphone_iphone_notify_received(LinphoneCore *lc, LinphoneEvent *lev, const char *notified_event, const LinphoneContent *body) { - [(LinphoneManager*)linphone_core_get_user_data(lc) onNotifyReceived:lc event:lev notifyEvent:notified_event content:body]; + [(__bridge LinphoneManager*)linphone_core_get_user_data(lc) onNotifyReceived:lc event:lev notifyEvent:notified_event content:body]; } #pragma mark - Message composition start @@ -966,7 +947,7 @@ static void linphone_iphone_notify_received(LinphoneCore *lc, LinphoneEvent *lev } static void linphone_iphone_is_composing_received(LinphoneCore *lc, LinphoneChatRoom *room){ - [(LinphoneManager*)linphone_core_get_user_data(lc) onMessageComposeReceived:lc forRoom:room]; + [(__bridge LinphoneManager*)linphone_core_get_user_data(lc) onMessageComposeReceived:lc forRoom:room]; } @@ -1169,14 +1150,14 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach // This notification is used to detect SSID change (switch of Wifi network). The ReachabilityCallback is // not triggered when switching between 2 private Wifi... // Since we cannot be sure we were already observer, remove ourself each time... to be improved - _SSID = [[LinphoneManager getCurrentWifiSSID] retain]; + _SSID = [LinphoneManager getCurrentWifiSSID]; CFNotificationCenterRemoveObserver( CFNotificationCenterGetDarwinNotifyCenter(), - self, + (__bridge const void *)(self), CFSTR("com.apple.system.config.network_change"), NULL); CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), - self, + (__bridge const void *)(self), networkReachabilityNotification, CFSTR("com.apple.system.config.network_change"), NULL, @@ -1217,7 +1198,7 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach return [number intValue]; } else { CTTelephonyNetworkInfo* info = [[CTTelephonyNetworkInfo alloc] init]; - NSString* currentRadio = [info.currentRadioAccessTechnology autorelease]; + NSString* currentRadio = info.currentRadioAccessTechnology; if( [currentRadio isEqualToString:CTRadioAccessTechnologyEdge]){ return network_2g; } else if ([currentRadio isEqualToString:CTRadioAccessTechnologyLTE]){ @@ -1275,10 +1256,11 @@ static LinphoneCoreVTable linphonec_vtable = { linphone_core_set_user_agent(theLinphoneCore, [[[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"] stringByAppendingString:@"Iphone"] UTF8String], LINPHONE_IOS_VERSION); - [_contactSipField release]; - _contactSipField = [[self lpConfigStringForKey:@"contact_im_type_value" withDefault:@"SIP"] retain]; + _contactSipField = [self lpConfigStringForKey:@"contact_im_type_value" withDefault:@"SIP"]; - fastAddressBook = [[FastAddressBook alloc] init]; + if( fastAddressBook == nil ){ + fastAddressBook = [[FastAddressBook alloc] init]; + } linphone_core_set_root_ca(theLinphoneCore, lRootCa); // Set audio assets @@ -1416,7 +1398,6 @@ static BOOL libStarted = FALSE; cancelButtonTitle:NSLocalizedString(@"Ok",nil) otherButtonTitles:nil ,nil]; [error show]; - [error release]; } if ([UIApplication sharedApplication].applicationState == UIApplicationStateBackground) { @@ -1462,7 +1443,7 @@ static BOOL libStarted = FALSE; theLinphoneCore = linphone_core_new_with_config (&linphonec_vtable ,configDb - ,self /* user_data */); + ,(__bridge void *)(self) /* user_data */); @@ -1536,7 +1517,7 @@ static int comp_call_id(const LinphoneCall* call , const char *callid) { MSList* calls = (MSList*)linphone_core_get_calls(theLinphoneCore); MSList* call = ms_list_find_custom(calls, (MSCompareFunc)comp_call_id, [callid UTF8String]); if (call != NULL) { - LinphoneCallAppData* data = linphone_call_get_user_pointer((LinphoneCall*)call->data); + LinphoneCallAppData* data = (__bridge LinphoneCallAppData *)(linphone_call_get_user_data((LinphoneCall*)call->data)); if ( data->timer ) [data->timer invalidate]; data->timer = nil; @@ -1623,10 +1604,7 @@ static int comp_call_state_paused (const LinphoneCall* call, const void* param) if ([[UIApplication sharedApplication] setKeepAliveTimeout:600/*(NSTimeInterval)linphone_proxy_config_get_expires(proxyCfg)*/ handler:^{ LOGW(@"keepalive handler"); - if (mLastKeepAliveDate) - [mLastKeepAliveDate release]; mLastKeepAliveDate=[NSDate date]; - [mLastKeepAliveDate retain]; if (theLinphoneCore == nil) { LOGW(@"It seems that Linphone BG mode was deactivated, just skipping"); return; @@ -1745,7 +1723,7 @@ static int comp_call_state_paused (const LinphoneCall* call, const void* param) UInt32 lNewRouteSize = sizeof(lNewRoute); OSStatus lStatus = AudioSessionGetProperty(kAudioSessionProperty_AudioRoute, &lNewRouteSize, &lNewRoute); if (!lStatus && lNewRouteSize > 0) { - NSString *route = (NSString *) lNewRoute; + NSString *route = (__bridge NSString *) lNewRoute; notallow = [route isEqualToString: @"Headset"] || [route isEqualToString: @"Headphone"] || [route isEqualToString: @"HeadphonesAndMicrophone"] || @@ -1764,14 +1742,14 @@ static void audioRouteChangeListenerCallback ( const void *inPropertyValue // 4 ) { if (inPropertyID != kAudioSessionProperty_AudioRouteChange) return; // 5 - LinphoneManager* lm = (LinphoneManager*)inUserData; + LinphoneManager* lm = (__bridge LinphoneManager*)inUserData; bool speakerEnabled = false; CFStringRef lNewRoute = CFSTR("Unknown"); UInt32 lNewRouteSize = sizeof(lNewRoute); OSStatus lStatus = AudioSessionGetProperty(kAudioSessionProperty_AudioRoute, &lNewRouteSize, &lNewRoute); if (!lStatus && lNewRouteSize > 0) { - NSString *route = (NSString *) lNewRoute; + NSString *route = (__bridge NSString *) lNewRoute; LOGI(@"Current audio route is [%s]", [route cStringUsingEncoding:[NSString defaultCStringEncoding]]); speakerEnabled = [route isEqualToString: @"Speaker"] || @@ -1850,7 +1828,6 @@ static void audioRouteChangeListenerCallback ( cancelButtonTitle:NSLocalizedString(@"Continue",nil) otherButtonTitles:nil]; [error show]; - [error release]; return; } @@ -1863,11 +1840,8 @@ static void audioRouteChangeListenerCallback ( cancelButtonTitle:NSLocalizedString(@"Continue",nil) otherButtonTitles:nil]; [error show]; - [error release]; - [callCenter release]; return; } - [callCenter release]; LinphoneProxyConfig* proxyCfg; //get default proxy @@ -1892,7 +1866,6 @@ static void audioRouteChangeListenerCallback ( cancelButtonTitle:NSLocalizedString(@"Continue",nil) otherButtonTitles:nil]; [error show]; - [error release]; } LinphoneAddress* linphoneAddress = linphone_core_interpret_url(theLinphoneCore, [address cStringUsingEncoding:[NSString defaultCStringEncoding]]); @@ -1919,7 +1892,6 @@ static void audioRouteChangeListenerCallback ( cancelButtonTitle:NSLocalizedString(@"Continue",nil) otherButtonTitles:nil]; [error show]; - [error release]; } @@ -1927,8 +1899,8 @@ static void audioRouteChangeListenerCallback ( if (call) { // The LinphoneCallAppData object should be set on call creation with callback // - (void)onCall:StateChanged:withMessage:. If not, we are in big trouble and expect it to crash - // We are NOT responsible for creating the AppData. - LinphoneCallAppData* data=(LinphoneCallAppData*)linphone_call_get_user_pointer(call); + // We are NOT responsible for creating the AppData. + LinphoneCallAppData* data=(__bridge LinphoneCallAppData*)linphone_call_get_user_data(call); if (data==nil) LOGE(@"New call instanciated but app data was not set. Expect it to crash."); /* will be used later to notify user if video was not activated because of the linphone core*/ @@ -1946,12 +1918,11 @@ static void audioRouteChangeListenerCallback ( return; } if(pushNotificationToken != nil) { - [pushNotificationToken release]; pushNotificationToken = nil; } if(apushNotificationToken != nil) { - pushNotificationToken = [apushNotificationToken retain]; + pushNotificationToken = apushNotificationToken; } LinphoneProxyConfig *cfg=nil; linphone_core_get_default_proxy(theLinphoneCore, &cfg); @@ -2110,7 +2081,6 @@ static void audioRouteChangeListenerCallback ( NSData* data = [NSJSONSerialization dataWithJSONObject:appDataDict options:0 error:nil]; NSString* appdataJSON = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; linphone_chat_message_set_appdata(msg, [appdataJSON UTF8String]); - [appdataJSON release]; } #pragma mark - LPConfig Functions @@ -2181,7 +2151,6 @@ static void audioRouteChangeListenerCallback ( if (mCallCenter != nil) { LOGI(@"Removing CT call center listener [%p]",mCallCenter); mCallCenter.callEventHandler=NULL; - [mCallCenter release]; } mCallCenter=nil; } @@ -2191,10 +2160,12 @@ static void audioRouteChangeListenerCallback ( [self removeCTCallCenterCb]; mCallCenter = [[CTCallCenter alloc] init]; LOGI(@"Adding CT call center listener [%p]",mCallCenter); + __block __weak LinphoneManager* weakSelf = self; + __block __weak CTCallCenter* weakCCenter = mCallCenter; mCallCenter.callEventHandler = ^(CTCall* call) { // post on main thread - [self performSelectorOnMainThread:@selector(handleGSMCallInteration:) - withObject:mCallCenter + [weakSelf performSelectorOnMainThread:@selector(handleGSMCallInteration:) + withObject:weakCCenter waitUntilDone:YES]; }; diff --git a/Classes/LinphoneUI/UIBluetoothButton.m b/Classes/LinphoneUI/UIBluetoothButton.m index b5c3d35a5..4a834037c 100644 --- a/Classes/LinphoneUI/UIBluetoothButton.m +++ b/Classes/LinphoneUI/UIBluetoothButton.m @@ -66,8 +66,5 @@ if (au!=0) LOGE(@"UIBluetoothButton error for %s: ret=%ld",method,au) return false; } -- (void)dealloc { - [super dealloc]; -} @end diff --git a/Classes/LinphoneUI/UICallBar.h b/Classes/LinphoneUI/UICallBar.h index 832a5906c..4574531e5 100644 --- a/Classes/LinphoneUI/UICallBar.h +++ b/Classes/LinphoneUI/UICallBar.h @@ -30,40 +30,40 @@ @interface UICallBar: TPMultiLayoutViewController { } -@property (nonatomic, retain) IBOutlet UIPauseButton* pauseButton; -@property (nonatomic, retain) IBOutlet UIButton* conferenceButton; -@property (nonatomic, retain) IBOutlet UIVideoButton* videoButton; -@property (nonatomic, retain) IBOutlet UIMicroButton* microButton; -@property (nonatomic, retain) IBOutlet UISpeakerButton* speakerButton; -@property (nonatomic, retain) IBOutlet UIToggleButton* routesButton; -@property (nonatomic, retain) IBOutlet UIToggleButton* optionsButton; -@property (nonatomic, retain) IBOutlet UIHangUpButton* hangupButton; -@property (nonatomic, retain) IBOutlet UIView* padView; -@property (nonatomic, retain) IBOutlet UIView* routesView; -@property (nonatomic, retain) IBOutlet UIView* optionsView; -@property (nonatomic, retain) IBOutlet UIButton* routesReceiverButton; -@property (nonatomic, retain) IBOutlet UIButton* routesSpeakerButton; -@property (nonatomic, retain) IBOutlet UIButton* routesBluetoothButton; -@property (nonatomic, retain) IBOutlet UIButton* optionsAddButton; -@property (nonatomic, retain) IBOutlet UIButton* optionsTransferButton; -@property (nonatomic, retain) IBOutlet UIToggleButton* dialerButton; +@property (nonatomic, strong) IBOutlet UIPauseButton* pauseButton; +@property (nonatomic, strong) IBOutlet UIButton* conferenceButton; +@property (nonatomic, strong) IBOutlet UIVideoButton* videoButton; +@property (nonatomic, strong) IBOutlet UIMicroButton* microButton; +@property (nonatomic, strong) IBOutlet UISpeakerButton* speakerButton; +@property (nonatomic, strong) IBOutlet UIToggleButton* routesButton; +@property (nonatomic, strong) IBOutlet UIToggleButton* optionsButton; +@property (nonatomic, strong) IBOutlet UIHangUpButton* hangupButton; +@property (nonatomic, strong) IBOutlet UIView* padView; +@property (nonatomic, strong) IBOutlet UIView* routesView; +@property (nonatomic, strong) IBOutlet UIView* optionsView; +@property (nonatomic, strong) IBOutlet UIButton* routesReceiverButton; +@property (nonatomic, strong) IBOutlet UIButton* routesSpeakerButton; +@property (nonatomic, strong) IBOutlet UIButton* routesBluetoothButton; +@property (nonatomic, strong) IBOutlet UIButton* optionsAddButton; +@property (nonatomic, strong) IBOutlet UIButton* optionsTransferButton; +@property (nonatomic, strong) IBOutlet UIToggleButton* dialerButton; -@property (nonatomic, retain) IBOutlet UIImageView* leftPadding; -@property (nonatomic, retain) IBOutlet UIImageView* rightPadding; +@property (nonatomic, strong) IBOutlet UIImageView* leftPadding; +@property (nonatomic, strong) IBOutlet UIImageView* rightPadding; -@property (nonatomic, retain) IBOutlet UIDigitButton* oneButton; -@property (nonatomic, retain) IBOutlet UIDigitButton* twoButton; -@property (nonatomic, retain) IBOutlet UIDigitButton* threeButton; -@property (nonatomic, retain) IBOutlet UIDigitButton* fourButton; -@property (nonatomic, retain) IBOutlet UIDigitButton* fiveButton; -@property (nonatomic, retain) IBOutlet UIDigitButton* sixButton; -@property (nonatomic, retain) IBOutlet UIDigitButton* sevenButton; -@property (nonatomic, retain) IBOutlet UIDigitButton* eightButton; -@property (nonatomic, retain) IBOutlet UIDigitButton* nineButton; -@property (nonatomic, retain) IBOutlet UIDigitButton* starButton; -@property (nonatomic, retain) IBOutlet UIDigitButton* zeroButton; -@property (nonatomic, retain) IBOutlet UIDigitButton* sharpButton; +@property (nonatomic, strong) IBOutlet UIDigitButton* oneButton; +@property (nonatomic, strong) IBOutlet UIDigitButton* twoButton; +@property (nonatomic, strong) IBOutlet UIDigitButton* threeButton; +@property (nonatomic, strong) IBOutlet UIDigitButton* fourButton; +@property (nonatomic, strong) IBOutlet UIDigitButton* fiveButton; +@property (nonatomic, strong) IBOutlet UIDigitButton* sixButton; +@property (nonatomic, strong) IBOutlet UIDigitButton* sevenButton; +@property (nonatomic, strong) IBOutlet UIDigitButton* eightButton; +@property (nonatomic, strong) IBOutlet UIDigitButton* nineButton; +@property (nonatomic, strong) IBOutlet UIDigitButton* starButton; +@property (nonatomic, strong) IBOutlet UIDigitButton* zeroButton; +@property (nonatomic, strong) IBOutlet UIDigitButton* sharpButton; - (IBAction)onRoutesClick:(id)sender; - (IBAction)onRoutesBluetoothClick:(id)sender; diff --git a/Classes/LinphoneUI/UICallBar.m b/Classes/LinphoneUI/UICallBar.m index 92d86dedb..358aaf923 100644 --- a/Classes/LinphoneUI/UICallBar.m +++ b/Classes/LinphoneUI/UICallBar.m @@ -67,40 +67,11 @@ } - (void)dealloc { - [pauseButton release]; - [conferenceButton release]; - [videoButton release]; - [microButton release]; - [speakerButton release]; - [routesButton release]; - [optionsButton release]; - [routesBluetoothButton release]; - [routesReceiverButton release]; - [routesSpeakerButton release]; - [optionsAddButton release]; - [optionsTransferButton release]; - [dialerButton release]; - [oneButton release]; - [twoButton release]; - [threeButton release]; - [fourButton release]; - [fiveButton release]; - [sixButton release]; - [sevenButton release]; - [eightButton release]; - [nineButton release]; - [starButton release]; - [zeroButton release]; - [sharpButton release]; - [padView release]; - [routesView release]; - [optionsView release]; [[NSNotificationCenter defaultCenter] removeObserver:self]; - [super dealloc]; } diff --git a/Classes/LinphoneUI/UICallButton.h b/Classes/LinphoneUI/UICallButton.h index d8b317a1d..5822404d6 100644 --- a/Classes/LinphoneUI/UICallButton.h +++ b/Classes/LinphoneUI/UICallButton.h @@ -23,6 +23,6 @@ @interface UICallButton : UIButton { } -@property (nonatomic, retain) IBOutlet UITextField* addressField; +@property (nonatomic, strong) IBOutlet UITextField* addressField; @end diff --git a/Classes/LinphoneUI/UICallButton.m b/Classes/LinphoneUI/UICallButton.m index 000e67f00..6442d6d8a 100644 --- a/Classes/LinphoneUI/UICallButton.m +++ b/Classes/LinphoneUI/UICallButton.m @@ -57,11 +57,6 @@ return self; } -- (void)dealloc { - [addressField release]; - - [super dealloc]; -} #pragma mark - diff --git a/Classes/LinphoneUI/UICallCell.h b/Classes/LinphoneUI/UICallCell.h index f79714ce1..71dbcb34d 100644 --- a/Classes/LinphoneUI/UICallCell.h +++ b/Classes/LinphoneUI/UICallCell.h @@ -39,61 +39,61 @@ typedef enum _UICallCellOtherView { - (id)init:(LinphoneCall*) call minimized:(BOOL)minimized; -@property (nonatomic, retain) UIImage *image; -@property (nonatomic, retain) NSString *address; +@property (nonatomic, strong) UIImage *image; +@property (nonatomic, strong) NSString *address; @end @interface UICallCell : UITransparentTVCell { } -@property (nonatomic, retain) UICallCellData *data; +@property (nonatomic, strong) UICallCellData *data; -@property (nonatomic, retain) IBOutlet UIImageView* headerBackgroundImage; -@property (nonatomic, retain) IBOutlet UIImageView* headerBackgroundHighlightImage; +@property (nonatomic, strong) IBOutlet UIImageView* headerBackgroundImage; +@property (nonatomic, strong) IBOutlet UIImageView* headerBackgroundHighlightImage; -@property (nonatomic, retain) IBOutlet UILabel* addressLabel; -@property (nonatomic, retain) IBOutlet UILabel* stateLabel; -@property (nonatomic, retain) IBOutlet UIImageView* stateImage; -@property (nonatomic, retain) IBOutlet UIImageView* avatarImage; -@property (nonatomic, retain) IBOutlet UIButton *removeButton; -@property (nonatomic, retain) IBOutlet UIPauseButton *pauseButton; +@property (nonatomic, strong) IBOutlet UILabel* addressLabel; +@property (nonatomic, strong) IBOutlet UILabel* stateLabel; +@property (nonatomic, strong) IBOutlet UIImageView* stateImage; +@property (nonatomic, strong) IBOutlet UIImageView* avatarImage; +@property (nonatomic, strong) IBOutlet UIButton *removeButton; +@property (nonatomic, strong) IBOutlet UIPauseButton *pauseButton; -@property (nonatomic, retain) IBOutlet UIView* headerView; -@property (nonatomic, retain) IBOutlet UIView* avatarView; +@property (nonatomic, strong) IBOutlet UIView* headerView; +@property (nonatomic, strong) IBOutlet UIView* avatarView; -@property (nonatomic, retain) IBOutlet UIView* audioStatsView; +@property (nonatomic, strong) IBOutlet UIView* audioStatsView; -@property (nonatomic, retain) IBOutlet UILabel* audioCodecLabel; -@property (nonatomic, retain) IBOutlet UILabel* audioCodecHeaderLabel; -@property (nonatomic, retain) IBOutlet UILabel* audioUploadBandwidthLabel; -@property (nonatomic, retain) IBOutlet UILabel* audioUploadBandwidthHeaderLabel; -@property (nonatomic, retain) IBOutlet UILabel* audioDownloadBandwidthLabel; -@property (nonatomic, retain) IBOutlet UILabel* audioDownloadBandwidthHeaderLabel; -@property (nonatomic, retain) IBOutlet UILabel* audioIceConnectivityLabel; -@property (nonatomic, retain) IBOutlet UILabel* audioIceConnectivityHeaderLabel; +@property (nonatomic, strong) IBOutlet UILabel* audioCodecLabel; +@property (nonatomic, strong) IBOutlet UILabel* audioCodecHeaderLabel; +@property (nonatomic, strong) IBOutlet UILabel* audioUploadBandwidthLabel; +@property (nonatomic, strong) IBOutlet UILabel* audioUploadBandwidthHeaderLabel; +@property (nonatomic, strong) IBOutlet UILabel* audioDownloadBandwidthLabel; +@property (nonatomic, strong) IBOutlet UILabel* audioDownloadBandwidthHeaderLabel; +@property (nonatomic, strong) IBOutlet UILabel* audioIceConnectivityLabel; +@property (nonatomic, strong) IBOutlet UILabel* audioIceConnectivityHeaderLabel; -@property (nonatomic, retain) IBOutlet UIView* videoStatsView; +@property (nonatomic, strong) IBOutlet UIView* videoStatsView; -@property (nonatomic, retain) IBOutlet UILabel* videoCodecLabel; -@property (nonatomic, retain) IBOutlet UILabel* videoCodecHeaderLabel; +@property (nonatomic, strong) IBOutlet UILabel* videoCodecLabel; +@property (nonatomic, strong) IBOutlet UILabel* videoCodecHeaderLabel; -@property (retain, nonatomic) IBOutlet UILabel *videoSentSizeHeaderLabel; -@property (retain, nonatomic) IBOutlet UILabel *videoSentSizeLabel; -@property (retain, nonatomic) IBOutlet UILabel *videoRecvSizeHeaderLabel; -@property (retain, nonatomic) IBOutlet UILabel *videoRecvSizeLabel; +@property (strong, nonatomic) IBOutlet UILabel *videoSentSizeHeaderLabel; +@property (strong, nonatomic) IBOutlet UILabel *videoSentSizeLabel; +@property (strong, nonatomic) IBOutlet UILabel *videoRecvSizeHeaderLabel; +@property (strong, nonatomic) IBOutlet UILabel *videoRecvSizeLabel; -@property (nonatomic, retain) IBOutlet UILabel* videoUploadBandwidthLabel; -@property (nonatomic, retain) IBOutlet UILabel* videoUploadBandwidthHeaderLabel; -@property (nonatomic, retain) IBOutlet UILabel* videoDownloadBandwidthLabel; -@property (nonatomic, retain) IBOutlet UILabel* videoDownloadBandwidthHeaderLabel; -@property (nonatomic, retain) IBOutlet UILabel* videoIceConnectivityLabel; -@property (nonatomic, retain) IBOutlet UILabel* videoIceConnectivityHeaderLabel; +@property (nonatomic, strong) IBOutlet UILabel* videoUploadBandwidthLabel; +@property (nonatomic, strong) IBOutlet UILabel* videoUploadBandwidthHeaderLabel; +@property (nonatomic, strong) IBOutlet UILabel* videoDownloadBandwidthLabel; +@property (nonatomic, strong) IBOutlet UILabel* videoDownloadBandwidthHeaderLabel; +@property (nonatomic, strong) IBOutlet UILabel* videoIceConnectivityLabel; +@property (nonatomic, strong) IBOutlet UILabel* videoIceConnectivityHeaderLabel; -@property (nonatomic, retain) IBOutlet UIView* otherView; +@property (nonatomic, strong) IBOutlet UIView* otherView; -@property (nonatomic, retain) IBOutlet UISwipeGestureRecognizer *detailsLeftSwipeGestureRecognizer; -@property (nonatomic, retain) IBOutlet UISwipeGestureRecognizer *detailsRightSwipeGestureRecognizer; +@property (nonatomic, strong) IBOutlet UISwipeGestureRecognizer *detailsLeftSwipeGestureRecognizer; +@property (nonatomic, strong) IBOutlet UISwipeGestureRecognizer *detailsRightSwipeGestureRecognizer; @property (assign) BOOL firstCell; @property (assign) BOOL conferenceCell; diff --git a/Classes/LinphoneUI/UICallCell.m b/Classes/LinphoneUI/UICallCell.m index 25f9145e2..90634f21d 100644 --- a/Classes/LinphoneUI/UICallCell.m +++ b/Classes/LinphoneUI/UICallCell.m @@ -35,8 +35,8 @@ self->minimize = minimized; self->view = UICallCellOtherView_Avatar; self->call = acall; - image = [[UIImage imageNamed:@"avatar_unknown.png"] retain]; - address = [NSLocalizedString(@"Unknown",nil) retain]; + image = [UIImage imageNamed:@"avatar_unknown.png"]; + address = NSLocalizedString(@"Unknown",nil); [self update]; } return self; @@ -82,12 +82,6 @@ } } -- (void)dealloc { - [address release]; - [image release]; - - [super dealloc]; -} @end @@ -200,53 +194,16 @@ object:nil]; - [headerBackgroundImage release]; - [headerBackgroundHighlightImage release]; - [addressLabel release]; - [stateLabel release]; - [stateImage release]; - [avatarImage release]; - [pauseButton release]; - [removeButton release]; - [headerView release]; - [avatarView release]; - [audioStatsView release]; - [audioCodecLabel release]; - [audioCodecHeaderLabel release]; - [audioUploadBandwidthLabel release]; - [audioUploadBandwidthHeaderLabel release]; - [audioDownloadBandwidthLabel release]; - [audioDownloadBandwidthHeaderLabel release]; - [audioIceConnectivityLabel release]; - [audioIceConnectivityHeaderLabel release]; - [videoStatsView release]; - [videoCodecLabel release]; - [videoCodecHeaderLabel release]; - [videoUploadBandwidthLabel release]; - [videoUploadBandwidthHeaderLabel release]; - [videoDownloadBandwidthLabel release]; - [videoDownloadBandwidthHeaderLabel release]; - [videoIceConnectivityLabel release]; - [videoIceConnectivityHeaderLabel release]; - [otherView release]; - [data release]; - [detailsLeftSwipeGestureRecognizer release]; - [detailsRightSwipeGestureRecognizer release]; - [videoSentSizeHeaderLabel release]; - [videoSentSizeLabel release]; - [videoRecvSizeHeaderLabel release]; - [videoRecvSizeLabel release]; - [super dealloc]; } @@ -257,11 +214,10 @@ return; } if(data != nil) { - [data release]; data = nil; } if(adata != nil) { - data = [adata retain]; + data = adata; } } diff --git a/Classes/LinphoneUI/UICamSwitch.h b/Classes/LinphoneUI/UICamSwitch.h index ea58049a6..4ede4f04a 100644 --- a/Classes/LinphoneUI/UICamSwitch.h +++ b/Classes/LinphoneUI/UICamSwitch.h @@ -22,6 +22,6 @@ @interface UICamSwitch : UIButton -@property (nonatomic, assign) IBOutlet UIView* preview; +@property (nonatomic, weak) IBOutlet UIView* preview; @end diff --git a/Classes/LinphoneUI/UICamSwitch.m b/Classes/LinphoneUI/UICamSwitch.m index a97f143ba..3e9fe8deb 100644 --- a/Classes/LinphoneUI/UICamSwitch.m +++ b/Classes/LinphoneUI/UICamSwitch.m @@ -34,7 +34,7 @@ - (id)init { self = [super init]; if (self) { - [self initUICamSwitch]; + if (!(self = [self initUICamSwitch])) return nil; } return self; } @@ -43,7 +43,7 @@ self = [super initWithFrame:frame]; if (self) { - [self initUICamSwitch]; + if (!(self = [self initUICamSwitch])) return nil; } return self; } @@ -51,7 +51,7 @@ - (id)initWithCoder:(NSCoder *)decoder { self = [super initWithCoder:decoder]; if (self) { - [self initUICamSwitch]; + if (!(self = [self initUICamSwitch])) return nil; } return self; } diff --git a/Classes/LinphoneUI/UIChatCell.h b/Classes/LinphoneUI/UIChatCell.h index 10ae8d29c..f8b649cc8 100644 --- a/Classes/LinphoneUI/UIChatCell.h +++ b/Classes/LinphoneUI/UIChatCell.h @@ -27,12 +27,12 @@ LinphoneChatRoom* chatRoom; } -@property (nonatomic, retain) IBOutlet UIImageView *avatarImage; -@property (nonatomic, retain) IBOutlet UILabel* addressLabel; -@property (nonatomic, retain) IBOutlet UILabel* chatContentLabel; -@property (nonatomic, retain) IBOutlet UIButton * deleteButton; -@property (nonatomic, retain) IBOutlet UIView * unreadMessageView; -@property (nonatomic, retain) IBOutlet UILabel * unreadMessageLabel; +@property (nonatomic, strong) IBOutlet UIImageView *avatarImage; +@property (nonatomic, strong) IBOutlet UILabel* addressLabel; +@property (nonatomic, strong) IBOutlet UILabel* chatContentLabel; +@property (nonatomic, strong) IBOutlet UIButton * deleteButton; +@property (nonatomic, strong) IBOutlet UIView * unreadMessageView; +@property (nonatomic, strong) IBOutlet UILabel * unreadMessageLabel; - (id)initWithIdentifier:(NSString*)identifier; diff --git a/Classes/LinphoneUI/UIChatCell.m b/Classes/LinphoneUI/UIChatCell.m index 23fe84382..aacc5e510 100644 --- a/Classes/LinphoneUI/UIChatCell.m +++ b/Classes/LinphoneUI/UIChatCell.m @@ -49,16 +49,6 @@ return self; } -- (void)dealloc { - [addressLabel release]; - [chatContentLabel release]; - [avatarImage release]; - [deleteButton release]; - [unreadMessageLabel release]; - [unreadMessageView release]; - - [super dealloc]; -} #pragma mark - Property Funcitons diff --git a/Classes/LinphoneUI/UIChatRoomCell.h b/Classes/LinphoneUI/UIChatRoomCell.h index eb7c75d2b..d71a9ec27 100644 --- a/Classes/LinphoneUI/UIChatRoomCell.h +++ b/Classes/LinphoneUI/UIChatRoomCell.h @@ -30,22 +30,22 @@ LinphoneChatMessage* chat; } -@property (nonatomic, retain) IBOutlet UIView *innerView; -@property (nonatomic, retain) IBOutlet UIView *bubbleView; -@property (nonatomic, retain) IBOutlet UIImageView* backgroundImage; -@property (nonatomic, retain) IBOutlet UITextViewNoDefine *messageText; -@property (nonatomic, retain) IBOutlet UILoadingImageView *messageImageView; -@property (nonatomic, retain) IBOutlet UIButton *deleteButton; -@property (nonatomic, retain) IBOutlet UILabel *dateLabel; -@property (nonatomic, retain) IBOutlet UIImageView* statusImage; -@property (nonatomic, retain) IBOutlet UIButton* downloadButton; -@property (nonatomic, retain) IBOutlet UITapGestureRecognizer* imageTapGestureRecognizer; -@property (nonatomic, retain) IBOutlet UITapGestureRecognizer* resendTapGestureRecognizer; +@property (nonatomic, strong) IBOutlet UIView *innerView; +@property (nonatomic, strong) IBOutlet UIView *bubbleView; +@property (nonatomic, strong) IBOutlet UIImageView* backgroundImage; +@property (nonatomic, strong) IBOutlet UITextViewNoDefine *messageText; +@property (nonatomic, strong) IBOutlet UILoadingImageView *messageImageView; +@property (nonatomic, strong) IBOutlet UIButton *deleteButton; +@property (nonatomic, strong) IBOutlet UILabel *dateLabel; +@property (nonatomic, strong) IBOutlet UIImageView* statusImage; +@property (nonatomic, strong) IBOutlet UIButton* downloadButton; +@property (nonatomic, strong) IBOutlet UITapGestureRecognizer* imageTapGestureRecognizer; +@property (nonatomic, strong) IBOutlet UITapGestureRecognizer* resendTapGestureRecognizer; - (id)initWithIdentifier:(NSString*)identifier; + (CGFloat)height:(LinphoneChatMessage*)chatMessage width:(int)width; -@property (nonatomic, retain) id chatRoomDelegate; +@property (nonatomic, strong) id chatRoomDelegate; - (IBAction)onDeleteClick:(id)event; - (IBAction)onDownloadClick:(id)event; diff --git a/Classes/LinphoneUI/UIChatRoomCell.m b/Classes/LinphoneUI/UIChatRoomCell.m index f877557ad..45d02b40b 100644 --- a/Classes/LinphoneUI/UIChatRoomCell.m +++ b/Classes/LinphoneUI/UIChatRoomCell.m @@ -80,22 +80,6 @@ static UIFont *CELL_FONT = nil; return self; } -- (void)dealloc { - [chatRoomDelegate release]; - [backgroundImage release]; - [innerView release]; - [bubbleView release]; - [messageText release]; - [messageImageView release]; - [deleteButton release]; - [dateLabel release]; - [statusImage release]; - [downloadButton release]; - [imageTapGestureRecognizer release]; - [resendTapGestureRecognizer release]; - - [super dealloc]; -} #pragma mark - @@ -150,7 +134,6 @@ static UIFont *CELL_FONT = nil; [messageImageView setImage:image]; [messageImageView setFullImageUrl:asset]; [messageImageView stopLoading]; - [image release]; }); } }); @@ -174,7 +157,6 @@ static UIFont *CELL_FONT = nil; attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:17.0], NSForegroundColorAttributeName:[UIColor darkGrayColor]}]; messageText.attributedText = attr_text; - [attr_text release]; } else { messageText.text = @""; @@ -194,7 +176,6 @@ static UIFont *CELL_FONT = nil; NSLocale *locale = [NSLocale currentLocale]; [dateFormatter setLocale:locale]; [dateLabel setText:[dateFormatter stringFromDate:message_date]]; - [dateFormatter release]; LinphoneChatMessageState state = linphone_chat_message_get_state(chat); BOOL outgoing = linphone_chat_message_is_outgoing(chat); @@ -218,7 +199,6 @@ static UIFont *CELL_FONT = nil; initWithString:NSLocalizedString(@"Resend", @"Resend") attributes:@{NSForegroundColorAttributeName: [UIColor redColor]}]; [dateLabel setAttributedText:resend_text]; - [resend_text release]; } if( outgoing){ diff --git a/Classes/LinphoneUI/UICompositeViewController.h b/Classes/LinphoneUI/UICompositeViewController.h index 3af7e6741..8b8c6cb69 100644 --- a/Classes/LinphoneUI/UICompositeViewController.h +++ b/Classes/LinphoneUI/UICompositeViewController.h @@ -26,11 +26,11 @@ @interface UICompositeViewDescription: NSObject{ } -@property (retain) NSString *name; -@property (retain) NSString *content; -@property (retain) NSString *stateBar; +@property (strong) NSString *name; +@property (strong) NSString *content; +@property (strong) NSString *stateBar; @property (assign) BOOL stateBarEnabled; -@property (retain) NSString *tabBar; +@property (strong) NSString *tabBar; @property (assign) BOOL tabBarEnabled; @property (assign) BOOL fullscreen; @property (assign) BOOL landscapeMode; @@ -62,11 +62,11 @@ UIInterfaceOrientation currentOrientation; } -@property (retain) CATransition *viewTransition; +@property (strong) CATransition *viewTransition; -@property (nonatomic, retain) IBOutlet UIView* stateBarView; -@property (nonatomic, retain) IBOutlet UIView* contentView; -@property (nonatomic, retain) IBOutlet UIView* tabBarView; +@property (nonatomic, strong) IBOutlet UIView* stateBarView; +@property (nonatomic, strong) IBOutlet UIView* contentView; +@property (nonatomic, strong) IBOutlet UIView* tabBarView; - (void)changeView:(UICompositeViewDescription *)description; - (void)setFullScreen:(BOOL) enabled; diff --git a/Classes/LinphoneUI/UICompositeViewController.m b/Classes/LinphoneUI/UICompositeViewController.m index da3230d31..55f08de7f 100644 --- a/Classes/LinphoneUI/UICompositeViewController.m +++ b/Classes/LinphoneUI/UICompositeViewController.m @@ -73,20 +73,13 @@ return self; } -- (void)dealloc { - [name release]; - [content release]; - [stateBar release]; - [tabBar release]; - [super dealloc]; -} @end @interface UICompositeViewController () -@property (nonatomic, retain) UIViewController *stateBarViewController; -@property (nonatomic, retain) UIViewController *tabBarViewController; -@property (nonatomic, retain) UIViewController *contentViewController; +@property (nonatomic, strong) UIViewController *stateBarViewController; +@property (nonatomic, strong) UIViewController *tabBarViewController; +@property (nonatomic, strong) UIViewController *contentViewController; @end @@ -135,19 +128,6 @@ - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; - - [self.stateBarViewController release]; - [self.tabBarViewController release]; - [self.contentViewController release]; - - [contentView release]; - [stateBarView release]; - [tabBarView release]; - [viewControllerCache release]; - [viewTransition release]; - [currentViewDescription release]; - - [super dealloc]; } @@ -367,7 +347,7 @@ if(name != nil) { controller = [viewControllerCache objectForKey:name]; if(controller == nil) { - controller = [[[NSClassFromString(name) alloc] init] autorelease]; + controller = [[NSClassFromString(name) alloc] init]; [viewControllerCache setValue:controller forKey:name]; [controller view]; // Load the view } @@ -602,9 +582,6 @@ } // Dealloc old view description - if(oldViewDescription != nil) { - [oldViewDescription release]; - } } - (void) changeView:(UICompositeViewDescription *)description { @@ -625,7 +602,7 @@ } - (UIViewController *) getCurrentViewController { - return [[self.contentViewController retain] autorelease]; + return self.contentViewController; } - (BOOL)currentViewSupportsLandscape { diff --git a/Classes/LinphoneUI/UIConferenceHeader.h b/Classes/LinphoneUI/UIConferenceHeader.h index 5834c78ae..d4d25172f 100644 --- a/Classes/LinphoneUI/UIConferenceHeader.h +++ b/Classes/LinphoneUI/UIConferenceHeader.h @@ -24,8 +24,8 @@ @interface UIConferenceHeader : UIViewController { } -@property (nonatomic, retain) IBOutlet UIImageView* stateImage; -@property (nonatomic, retain) IBOutlet UIPauseButton *pauseButton; +@property (nonatomic, strong) IBOutlet UIImageView* stateImage; +@property (nonatomic, strong) IBOutlet UIPauseButton *pauseButton; + (int)getHeight; - (void)update; diff --git a/Classes/LinphoneUI/UIConferenceHeader.m b/Classes/LinphoneUI/UIConferenceHeader.m index 78947b5fc..62ff284a9 100644 --- a/Classes/LinphoneUI/UIConferenceHeader.m +++ b/Classes/LinphoneUI/UIConferenceHeader.m @@ -33,11 +33,6 @@ return [super initWithNibName:@"UIConferenceHeader" bundle:[NSBundle mainBundle]]; } -- (void)dealloc { - [stateImage release]; - [pauseButton release]; - [super dealloc]; -} #pragma mark - ViewController Functions diff --git a/Classes/LinphoneUI/UIContactCell.h b/Classes/LinphoneUI/UIContactCell.h index a5ecc54d7..06c26b305 100644 --- a/Classes/LinphoneUI/UIContactCell.h +++ b/Classes/LinphoneUI/UIContactCell.h @@ -24,9 +24,9 @@ @interface UIContactCell : UITransparentTVCell { } -@property (nonatomic, retain) IBOutlet UILabel* firstNameLabel; -@property (nonatomic, retain) IBOutlet UILabel* lastNameLabel; -@property (nonatomic, retain) IBOutlet UIImageView *avatarImage; +@property (nonatomic, strong) IBOutlet UILabel* firstNameLabel; +@property (nonatomic, strong) IBOutlet UILabel* lastNameLabel; +@property (nonatomic, strong) IBOutlet UIImageView *avatarImage; @property (nonatomic, assign) ABRecordRef contact; - (id)initWithIdentifier:(NSString*)identifier; diff --git a/Classes/LinphoneUI/UIContactCell.m b/Classes/LinphoneUI/UIContactCell.m index ad0945609..1826da270 100644 --- a/Classes/LinphoneUI/UIContactCell.m +++ b/Classes/LinphoneUI/UIContactCell.m @@ -44,13 +44,6 @@ return self; } -- (void) dealloc { - [firstNameLabel release]; - [lastNameLabel release]; - [avatarImage release]; - - [super dealloc]; -} #pragma mark - Property Functions @@ -88,31 +81,25 @@ CFStringRef lLocalizedOrganization = (lOrganization != nil)?ABAddressBookCopyLocalizedLabel(lOrganization):nil; if(lLocalizedFirstName != nil){ - [firstNameLabel setText: (NSString *)lLocalizedFirstName]; + [firstNameLabel setText: (NSString *)CFBridgingRelease(lLocalizedFirstName)]; } else [firstNameLabel setText: @""]; if(lLocalizedLastName != nil){ - [lastNameLabel setText: (NSString *)lLocalizedLastName]; + [lastNameLabel setText: (NSString *)CFBridgingRelease(lLocalizedLastName)]; } else [lastNameLabel setText: @""]; if(lLocalizedFirstName == nil && lLocalizedLastName == nil) { - [firstNameLabel setText: (NSString *)lLocalizedOrganization]; + [firstNameLabel setText: (NSString *)CFBridgingRelease(lLocalizedOrganization)]; } - if(lLocalizedOrganization != nil) - CFRelease(lLocalizedOrganization); if(lOrganization != nil) CFRelease(lOrganization); - if(lLocalizedLastName != nil) - CFRelease(lLocalizedLastName); if(lLastName != nil) CFRelease(lLastName); - if(lLocalizedFirstName != nil) - CFRelease(lLocalizedFirstName); if(lFirstName != nil) CFRelease(lFirstName); } diff --git a/Classes/LinphoneUI/UIContactDetailsFooter.h b/Classes/LinphoneUI/UIContactDetailsFooter.h index 79496261f..1fd974fe0 100644 --- a/Classes/LinphoneUI/UIContactDetailsFooter.h +++ b/Classes/LinphoneUI/UIContactDetailsFooter.h @@ -24,8 +24,8 @@ @interface UIContactDetailsFooter : UIViewController { } -@property (nonatomic, retain) IBOutlet UIButton *removeButton; -@property (nonatomic, retain) IBOutlet id contactDetailsDelegate; +@property (nonatomic, strong) IBOutlet UIButton *removeButton; +@property (nonatomic, strong) IBOutlet id contactDetailsDelegate; - (IBAction)onRemoveClick:(id)event; diff --git a/Classes/LinphoneUI/UIContactDetailsFooter.m b/Classes/LinphoneUI/UIContactDetailsFooter.m index e681aac04..935b12bd2 100644 --- a/Classes/LinphoneUI/UIContactDetailsFooter.m +++ b/Classes/LinphoneUI/UIContactDetailsFooter.m @@ -54,11 +54,6 @@ return self; } -- (void)dealloc { - [removeButton release]; - - [super dealloc]; -} #pragma mark - Action Functions diff --git a/Classes/LinphoneUI/UIContactDetailsHeader.h b/Classes/LinphoneUI/UIContactDetailsHeader.h index e76058bad..a6b20d296 100644 --- a/Classes/LinphoneUI/UIContactDetailsHeader.h +++ b/Classes/LinphoneUI/UIContactDetailsHeader.h @@ -31,15 +31,15 @@ @property (nonatomic, assign) ABRecordRef contact; -@property (nonatomic, retain) IBOutlet UILabel *addressLabel; -@property (nonatomic, retain) IBOutlet UIImageView *avatarImage; +@property (nonatomic, strong) IBOutlet UILabel *addressLabel; +@property (nonatomic, strong) IBOutlet UIImageView *avatarImage; -@property (nonatomic, retain) IBOutlet UIView *normalView; -@property (nonatomic, retain) IBOutlet UIView *editView; -@property (nonatomic, retain) IBOutlet UITableView *tableView; -@property (nonatomic, retain) IBOutlet id contactDetailsDelegate; +@property (nonatomic, strong) IBOutlet UIView *normalView; +@property (nonatomic, strong) IBOutlet UIView *editView; +@property (nonatomic, strong) IBOutlet UITableView *tableView; +@property (nonatomic, strong) IBOutlet id contactDetailsDelegate; -@property (retain, nonatomic) ImagePickerViewController* popoverController; +@property (strong, nonatomic) ImagePickerViewController* popoverController; @property(nonatomic,getter=isEditing) BOOL editing; diff --git a/Classes/LinphoneUI/UIContactDetailsHeader.m b/Classes/LinphoneUI/UIContactDetailsHeader.m index 3d9d9b331..07859fff1 100644 --- a/Classes/LinphoneUI/UIContactDetailsHeader.m +++ b/Classes/LinphoneUI/UIContactDetailsHeader.m @@ -72,17 +72,6 @@ return self; } -- (void)dealloc { - [avatarImage release]; - [addressLabel release]; - [normalView release]; - [editView release]; - [tableView release]; - - [propertyList release]; - - [super dealloc]; -} #pragma mark - ViewController Functions @@ -184,9 +173,8 @@ } + (NSString*)localizeLabel:(NSString*)str { - CFStringRef lLocalizedLabel = ABAddressBookCopyLocalizedLabel((CFStringRef) str); - NSString * retStr = [NSString stringWithString:(NSString*) lLocalizedLabel]; - CFRelease(lLocalizedLabel); + CFStringRef lLocalizedLabel = ABAddressBookCopyLocalizedLabel((__bridge CFStringRef) str); + NSString * retStr = (NSString*) CFBridgingRelease(lLocalizedLabel); return retStr; } @@ -204,7 +192,7 @@ static NSString *kCellId = @"ContactDetailsHeaderCell"; UIEditableTableViewCell *cell = [atableView dequeueReusableCellWithIdentifier:kCellId]; if (cell == nil) { - cell = [[[UIEditableTableViewCell alloc] initWithStyle:UITableViewCellStyleValue2 reuseIdentifier:kCellId] autorelease]; + cell = [[UIEditableTableViewCell alloc] initWithStyle:UITableViewCellStyleValue2 reuseIdentifier:kCellId]; [cell.detailTextField setAutocapitalizationType:UITextAutocapitalizationTypeWords]; [cell.detailTextField setAutocorrectionType:UITextAutocorrectionTypeNo]; [cell.detailTextField setKeyboardType:UIKeyboardTypeDefault]; @@ -225,11 +213,10 @@ // setup values, if they exist if(contact) { - CFStringRef lValue = ABRecordCopyValue(contact, property); + NSString* lValue = CFBridgingRelease( ABRecordCopyValue(contact, property) ); if(lValue != NULL) { - [cell.detailTextLabel setText:(NSString*)lValue]; - [cell.detailTextField setText:(NSString*)lValue]; - CFRelease(lValue); + [cell.detailTextLabel setText:lValue]; + [cell.detailTextField setText:lValue]; } else { [cell.detailTextLabel setText:@""]; [cell.detailTextField setText:@""]; @@ -272,7 +259,7 @@ } } }; - DTActionSheet *sheet = [[[DTActionSheet alloc] initWithTitle:NSLocalizedString(@"Select picture source",nil)] autorelease]; + DTActionSheet *sheet = [[DTActionSheet alloc] initWithTitle:NSLocalizedString(@"Select picture source",nil)]; if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) { [sheet addButtonWithTitle:NSLocalizedString(@"Camera",nil) block:^(){ showAppropriateController(UIImagePickerControllerSourceTypeCamera); @@ -285,9 +272,9 @@ } if([FastAddressBook getContactImage:contact thumbnail:true] != nil) { [sheet addDestructiveButtonWithTitle:NSLocalizedString(@"Remove", nil) block:^(){ - NSError* error = NULL; - if(!ABPersonRemoveImageData(contact, (CFErrorRef*)error)) { - LOGI(@"Can't remove entry: %@", [error localizedDescription]); + CFErrorRef error = NULL; + if(!ABPersonRemoveImageData(contact, (CFErrorRef*)&error)) { + LOGI(@"Can't remove entry: %@", [(__bridge NSError*)error localizedDescription]); } [self update]; }]; @@ -314,17 +301,17 @@ } } FastAddressBook* fab = [LinphoneManager instance].fastAddressBook; - NSError* error = NULL; - if(!ABPersonRemoveImageData(contact, (CFErrorRef*)error)) { - LOGI(@"Can't remove entry: %@", [error localizedDescription]); + CFErrorRef error = NULL; + if(!ABPersonRemoveImageData(contact, (CFErrorRef*)&error)) { + LOGI(@"Can't remove entry: %@", [(__bridge NSError*)error localizedDescription]); } NSData *dataRef = UIImageJPEGRepresentation(image, 0.9f); CFDataRef cfdata = CFDataCreate(NULL,[dataRef bytes], [dataRef length]); [fab saveAddressBook]; - if(!ABPersonSetImageData(contact, cfdata, (CFErrorRef*)error)) { - LOGI(@"Can't add entry: %@", [error localizedDescription]); + if(!ABPersonSetImageData(contact, cfdata, (CFErrorRef*)&error)) { + LOGI(@"Can't add entry: %@", [(__bridge NSError*)error localizedDescription]); } else { [fab saveAddressBook]; } @@ -367,10 +354,10 @@ NSIndexPath *indexPath = [self.tableView indexPathForCell:cell]; ABPropertyID property = [[propertyList objectAtIndex:[indexPath row]] intValue]; [cell.detailTextLabel setText:[textField text]]; - NSError* error = NULL; - ABRecordSetValue(contact, property, [textField text], (CFErrorRef*)&error); + CFErrorRef error = NULL; + ABRecordSetValue(contact, property, (__bridge CFTypeRef)([textField text]), (CFErrorRef*)&error); if (error != NULL) { - LOGE(@"Error when saving property %i in contact %p: Fail(%@)", property, contact, [error localizedDescription]); + LOGE(@"Error when saving property %i in contact %p: Fail(%@)", property, contact, [(__bridge NSError*)error localizedDescription]); } } else { LOGW(@"Not valid UIEditableTableViewCell"); diff --git a/Classes/LinphoneUI/UIDigitButton.h b/Classes/LinphoneUI/UIDigitButton.h index b680bab2c..afd6ddc8f 100644 --- a/Classes/LinphoneUI/UIDigitButton.h +++ b/Classes/LinphoneUI/UIDigitButton.h @@ -25,7 +25,7 @@ @interface UIDigitButton : UILongTouchButton { } -@property (nonatomic, retain) IBOutlet UITextField* addressField; +@property (nonatomic, strong) IBOutlet UITextField* addressField; @property char digit; @property bool dtmf; diff --git a/Classes/LinphoneUI/UIDigitButton.m b/Classes/LinphoneUI/UIDigitButton.m index 9f2f59127..d6d3d1446 100644 --- a/Classes/LinphoneUI/UIDigitButton.m +++ b/Classes/LinphoneUI/UIDigitButton.m @@ -60,10 +60,6 @@ return self; } -- (void)dealloc { - [addressField release]; - [super dealloc]; -} #pragma mark - Actions Functions diff --git a/Classes/LinphoneUI/UIEditableTableViewCell.h b/Classes/LinphoneUI/UIEditableTableViewCell.h index c75b046c8..07bc23c30 100644 --- a/Classes/LinphoneUI/UIEditableTableViewCell.h +++ b/Classes/LinphoneUI/UIEditableTableViewCell.h @@ -23,7 +23,7 @@ @interface UIEditableTableViewCell : UITransparentTVCell { } -@property (nonatomic, retain) IBOutlet UIView *verticalSep; -@property (nonatomic, retain) IBOutlet UITextField *detailTextField; +@property (nonatomic, strong) IBOutlet UIView *verticalSep; +@property (nonatomic, strong) IBOutlet UITextField *detailTextField; @end diff --git a/Classes/LinphoneUI/UIEditableTableViewCell.m b/Classes/LinphoneUI/UIEditableTableViewCell.m index 0d450c642..3772e1e19 100644 --- a/Classes/LinphoneUI/UIEditableTableViewCell.m +++ b/Classes/LinphoneUI/UIEditableTableViewCell.m @@ -51,16 +51,10 @@ [self.contentView addSubview:verticalSep]; - [tf release]; - [v release]; } return self; } -- (void)dealloc { - self.detailTextField = nil; - [super dealloc]; -} #pragma mark - View Functions diff --git a/Classes/LinphoneUI/UIEraseButton.h b/Classes/LinphoneUI/UIEraseButton.h index 795df2a60..d6e81012d 100644 --- a/Classes/LinphoneUI/UIEraseButton.h +++ b/Classes/LinphoneUI/UIEraseButton.h @@ -24,6 +24,6 @@ @interface UIEraseButton : UILongTouchButton { } -@property (nonatomic, assign) IBOutlet UITextField* addressField; +@property (nonatomic, weak) IBOutlet UITextField* addressField; @end diff --git a/Classes/LinphoneUI/UIEraseButton.m b/Classes/LinphoneUI/UIEraseButton.m index 0df88fae5..360b53931 100644 --- a/Classes/LinphoneUI/UIEraseButton.m +++ b/Classes/LinphoneUI/UIEraseButton.m @@ -57,7 +57,6 @@ - (void)dealloc { addressField = nil; - [super dealloc]; } diff --git a/Classes/LinphoneUI/UIHangUpButton.m b/Classes/LinphoneUI/UIHangUpButton.m index 899df975c..4dfa205bf 100644 --- a/Classes/LinphoneUI/UIHangUpButton.m +++ b/Classes/LinphoneUI/UIHangUpButton.m @@ -76,9 +76,6 @@ return self; } -- (void)dealloc { - [super dealloc]; -} #pragma mark - diff --git a/Classes/LinphoneUI/UIHistoryCell.h b/Classes/LinphoneUI/UIHistoryCell.h index 85e619235..8f9801a48 100644 --- a/Classes/LinphoneUI/UIHistoryCell.h +++ b/Classes/LinphoneUI/UIHistoryCell.h @@ -27,10 +27,10 @@ @property (nonatomic, assign) LinphoneCallLog *callLog; -@property (nonatomic, retain) IBOutlet UIImageView* imageView; -@property (nonatomic, retain) IBOutlet UILabel* addressLabel; -@property (nonatomic, retain) IBOutlet UIButton* detailsButton; -@property (nonatomic, retain) IBOutlet UIButton* deleteButton; +@property (nonatomic, strong) IBOutlet UIImageView* imageView; +@property (nonatomic, strong) IBOutlet UILabel* addressLabel; +@property (nonatomic, strong) IBOutlet UIButton* detailsButton; +@property (nonatomic, strong) IBOutlet UIButton* deleteButton; - (id)initWithIdentifier:(NSString*)identifier; diff --git a/Classes/LinphoneUI/UIHistoryCell.m b/Classes/LinphoneUI/UIHistoryCell.m index fbda68674..9e0294f41 100644 --- a/Classes/LinphoneUI/UIHistoryCell.m +++ b/Classes/LinphoneUI/UIHistoryCell.m @@ -47,14 +47,6 @@ return self; } -- (void) dealloc { - [detailsButton release]; - [deleteButton release]; - [addressLabel release]; - [imageView release]; - - [super dealloc]; -} #pragma mark - Action Functions diff --git a/Classes/LinphoneUI/UILinphone.m b/Classes/LinphoneUI/UILinphone.m index c069f9f8a..e9a9e4287 100644 --- a/Classes/LinphoneUI/UILinphone.m +++ b/Classes/LinphoneUI/UILinphone.m @@ -122,7 +122,7 @@ UIImage *decompressedImage = [[UIImage alloc] initWithCGImage:decompressedImageRef scale:image.scale orientation:image.imageOrientation]; CGImageRelease(decompressedImageRef); - return [decompressedImage autorelease]; + return decompressedImage; } @end diff --git a/Classes/LinphoneUI/UILinphoneButton.h b/Classes/LinphoneUI/UILinphoneButton.h index 7b390c40d..bebee47dd 100644 --- a/Classes/LinphoneUI/UILinphoneButton.h +++ b/Classes/LinphoneUI/UILinphoneButton.h @@ -24,7 +24,7 @@ } -@property (retain, nonatomic) IBOutlet TUNinePatch *backgroundNinePatch; -@property (retain, nonatomic) IBOutlet TUNinePatch *backgroundOverNinePatch; +@property (strong, nonatomic) IBOutlet TUNinePatch *backgroundNinePatch; +@property (strong, nonatomic) IBOutlet TUNinePatch *backgroundOverNinePatch; @end diff --git a/Classes/LinphoneUI/UILinphoneTextField.h b/Classes/LinphoneUI/UILinphoneTextField.h index a6445665e..7fab4cbbe 100644 --- a/Classes/LinphoneUI/UILinphoneTextField.h +++ b/Classes/LinphoneUI/UILinphoneTextField.h @@ -24,6 +24,6 @@ } -@property (retain, nonatomic) IBOutlet TUNinePatch *backgroundNinePatch; +@property (strong, nonatomic) IBOutlet TUNinePatch *backgroundNinePatch; @end diff --git a/Classes/LinphoneUI/UILinphoneTextField.m b/Classes/LinphoneUI/UILinphoneTextField.m index 8eaf12fc4..312d35ad9 100644 --- a/Classes/LinphoneUI/UILinphoneTextField.m +++ b/Classes/LinphoneUI/UILinphoneTextField.m @@ -56,11 +56,6 @@ return self; } -- (void)dealloc { - [backgroundNinePatch release]; - - [super dealloc]; -} - (CGRect)textRectForBounds:(CGRect)bounds { return CGRectInset(bounds, 6, 4); diff --git a/Classes/LinphoneUI/UILoadingImageView.h b/Classes/LinphoneUI/UILoadingImageView.h index 5fcfe2f7e..04025c3a3 100644 --- a/Classes/LinphoneUI/UILoadingImageView.h +++ b/Classes/LinphoneUI/UILoadingImageView.h @@ -28,7 +28,7 @@ - (BOOL)isLoading; - (void)stopLoading; -@property (nonatomic, retain) ALAsset* fullImageUrl; +@property (nonatomic, strong) ALAsset* fullImageUrl; @property (nonatomic, readonly) IBOutlet UIActivityIndicatorView *waitIndicatorView; @end diff --git a/Classes/LinphoneUI/UILoadingImageView.m b/Classes/LinphoneUI/UILoadingImageView.m index ceaaa06e5..388a3e567 100644 --- a/Classes/LinphoneUI/UILoadingImageView.m +++ b/Classes/LinphoneUI/UILoadingImageView.m @@ -76,11 +76,6 @@ return self; } -- (void)dealloc { - [waitIndicatorView release]; - - [super dealloc]; -} #pragma mark - diff --git a/Classes/LinphoneUI/UILongTouchButton.m b/Classes/LinphoneUI/UILongTouchButton.m index c4f1b0a21..01e12e2f0 100644 --- a/Classes/LinphoneUI/UILongTouchButton.m +++ b/Classes/LinphoneUI/UILongTouchButton.m @@ -33,7 +33,7 @@ - (id)init { self = [super init]; if (self) { - [self initUILongTouchButton]; + if (!(self = [self initUILongTouchButton])) return nil; } return self; } @@ -41,7 +41,7 @@ - (id)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { - [self initUILongTouchButton]; + if (!(self = [self initUILongTouchButton])) return nil; } return self; } @@ -49,7 +49,7 @@ - (id)initWithCoder:(NSCoder *)decoder { self = [super initWithCoder:decoder]; if (self) { - [self initUILongTouchButton]; + if (!(self = [self initUILongTouchButton])) return nil; } return self; } @@ -57,7 +57,6 @@ - (void)dealloc { [self removeTarget:self action:@selector(___touchDown:) forControlEvents:UIControlEventTouchDown]; [self removeTarget:self action:@selector(___touchUp:) forControlEvents:UIControlEventTouchUpInside|UIControlEventTouchUpOutside]; - [super dealloc]; } - (void)___touchDown:(id) sender { diff --git a/Classes/LinphoneUI/UIMainBar.h b/Classes/LinphoneUI/UIMainBar.h index 7038ba394..b2802dda7 100644 --- a/Classes/LinphoneUI/UIMainBar.h +++ b/Classes/LinphoneUI/UIMainBar.h @@ -23,15 +23,15 @@ @interface UIMainBar : TPMultiLayoutViewController { } -@property (nonatomic, retain) IBOutlet UIButton* historyButton; -@property (nonatomic, retain) IBOutlet UIButton* contactsButton; -@property (nonatomic, retain) IBOutlet UIButton* dialerButton; -@property (nonatomic, retain) IBOutlet UIButton* settingsButton; -@property (nonatomic, retain) IBOutlet UIButton* chatButton; -@property (nonatomic, retain) IBOutlet UIView *historyNotificationView; -@property (nonatomic, retain) IBOutlet UILabel *historyNotificationLabel; -@property (nonatomic, retain) IBOutlet UIView *chatNotificationView; -@property (nonatomic, retain) IBOutlet UILabel *chatNotificationLabel; +@property (nonatomic, strong) IBOutlet UIButton* historyButton; +@property (nonatomic, strong) IBOutlet UIButton* contactsButton; +@property (nonatomic, strong) IBOutlet UIButton* dialerButton; +@property (nonatomic, strong) IBOutlet UIButton* settingsButton; +@property (nonatomic, strong) IBOutlet UIButton* chatButton; +@property (nonatomic, strong) IBOutlet UIView *historyNotificationView; +@property (nonatomic, strong) IBOutlet UILabel *historyNotificationLabel; +@property (nonatomic, strong) IBOutlet UIView *chatNotificationView; +@property (nonatomic, strong) IBOutlet UILabel *chatNotificationLabel; -(IBAction) onHistoryClick: (id) event; -(IBAction) onContactsClick: (id) event; diff --git a/Classes/LinphoneUI/UIMainBar.m b/Classes/LinphoneUI/UIMainBar.m index 749158525..49ed0c95b 100644 --- a/Classes/LinphoneUI/UIMainBar.m +++ b/Classes/LinphoneUI/UIMainBar.m @@ -47,17 +47,7 @@ static NSString * const kDisappearAnimation = @"disappear"; - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; - [historyButton release]; - [contactsButton release]; - [dialerButton release]; - [settingsButton release]; - [chatButton release]; - [historyNotificationView release]; - [historyNotificationLabel release]; - [chatNotificationView release]; - [chatNotificationLabel release]; - [super dealloc]; } diff --git a/Classes/LinphoneUI/UIMicroButton.m b/Classes/LinphoneUI/UIMicroButton.m index 312d238d8..e5c94fa04 100644 --- a/Classes/LinphoneUI/UIMicroButton.m +++ b/Classes/LinphoneUI/UIMicroButton.m @@ -35,8 +35,5 @@ return linphone_core_is_mic_muted([LinphoneManager getLc]) == false; } -- (void)dealloc { - [super dealloc]; -} @end diff --git a/Classes/LinphoneUI/UISpeakerButton.m b/Classes/LinphoneUI/UISpeakerButton.m index 9e21f3997..0e4e7e899 100644 --- a/Classes/LinphoneUI/UISpeakerButton.m +++ b/Classes/LinphoneUI/UISpeakerButton.m @@ -36,13 +36,13 @@ static void audioRouteChangeListenerCallback ( const void *inPropertyValue // 4 ) { if (inPropertyID != kAudioSessionProperty_AudioRouteChange) return; // 5 - UISpeakerButton* button = (UISpeakerButton*)inUserData; + UISpeakerButton* button = (__bridge UISpeakerButton*)inUserData; [button update]; } - (void)initUISpeakerButton { AudioSessionInitialize(NULL, NULL, NULL, NULL); - OSStatus lStatus = AudioSessionAddPropertyListener(kAudioSessionProperty_AudioRouteChange, audioRouteChangeListenerCallback, self); + OSStatus lStatus = AudioSessionAddPropertyListener(kAudioSessionProperty_AudioRouteChange, audioRouteChangeListenerCallback, (__bridge void *)(self)); if (lStatus) { LOGE(@"cannot register route change handler [%ld]",lStatus); } @@ -73,11 +73,10 @@ static void audioRouteChangeListenerCallback ( } - (void)dealloc { - OSStatus lStatus = AudioSessionRemovePropertyListenerWithUserData(kAudioSessionProperty_AudioRouteChange, audioRouteChangeListenerCallback, self); + OSStatus lStatus = AudioSessionRemovePropertyListenerWithUserData(kAudioSessionProperty_AudioRouteChange, audioRouteChangeListenerCallback, (__bridge void *)(self)); if (lStatus) { LOGE(@"cannot un register route change handler [%ld]", lStatus); } - [super dealloc]; } diff --git a/Classes/LinphoneUI/UIStateBar.h b/Classes/LinphoneUI/UIStateBar.h index 735cb9bd7..10c179f7b 100644 --- a/Classes/LinphoneUI/UIStateBar.h +++ b/Classes/LinphoneUI/UIStateBar.h @@ -25,12 +25,12 @@ DTActionSheet *securitySheet; } -@property (nonatomic, retain) IBOutlet UIImageView* registrationStateImage; -@property (nonatomic, retain) IBOutlet UILabel* registrationStateLabel; -@property (nonatomic, retain) IBOutlet UIImageView* callQualityImage; -@property (nonatomic, retain) IBOutlet UIImageView* callSecurityImage; -@property (nonatomic, retain) IBOutlet UIButton* callSecurityButton; -@property (retain, nonatomic) IBOutlet UILabel *voicemailCount; +@property (nonatomic, strong) IBOutlet UIImageView* registrationStateImage; +@property (nonatomic, strong) IBOutlet UILabel* registrationStateLabel; +@property (nonatomic, strong) IBOutlet UIImageView* callQualityImage; +@property (nonatomic, strong) IBOutlet UIImageView* callSecurityImage; +@property (nonatomic, strong) IBOutlet UIButton* callSecurityButton; +@property (strong, nonatomic) IBOutlet UILabel *voicemailCount; - (IBAction)doSecurityClick:(id)sender; diff --git a/Classes/LinphoneUI/UIStateBar.m b/Classes/LinphoneUI/UIStateBar.m index 02e553283..e6e507605 100644 --- a/Classes/LinphoneUI/UIStateBar.m +++ b/Classes/LinphoneUI/UIStateBar.m @@ -21,7 +21,13 @@ #import "LinphoneManager.h" #import "PhoneMainView.h" -@implementation UIStateBar +@implementation UIStateBar { + + NSTimer *callQualityTimer; + NSTimer *callSecurityTimer; + int messagesUnreadCount; + +} @synthesize registrationStateImage; @synthesize registrationStateLabel; @@ -29,10 +35,6 @@ @synthesize callSecurityImage; @synthesize callSecurityButton; -NSTimer *callQualityTimer; -NSTimer *callSecurityTimer; -int messagesUnreadCount; - #pragma mark - Lifecycle Functions - (id)init { @@ -46,19 +48,8 @@ int messagesUnreadCount; } - (void) dealloc { - if(securitySheet) { - [securitySheet release]; - } - [registrationStateImage release]; - [registrationStateLabel release]; - [callQualityImage release]; - [callSecurityImage release]; - [callSecurityButton release]; [[NSNotificationCenter defaultCenter] removeObserver:self]; [callQualityTimer invalidate]; - [callQualityTimer release]; - [_voicemailCount release]; - [super dealloc]; } @@ -337,17 +328,16 @@ int messagesUnreadCount; linphone_call_get_authentication_token(call)]; } if( securitySheet == nil ){ + __block __strong UIStateBar* weakSelf = self; securitySheet = [[DTActionSheet alloc] initWithTitle:message]; [securitySheet setDelegate:self]; [securitySheet addButtonWithTitle:NSLocalizedString(@"Ok",nil) block:^(){ linphone_call_set_authentication_token_verified(call, !valid); - [securitySheet release]; - securitySheet = nil; + weakSelf->securitySheet = nil; }]; [securitySheet addDestructiveButtonWithTitle:NSLocalizedString(@"Cancel",nil) block:^(){ - [securitySheet release]; - securitySheet = nil; + weakSelf->securitySheet = nil; }]; [securitySheet showInView:[PhoneMainView instance].view]; } @@ -357,7 +347,6 @@ int messagesUnreadCount; } -(void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex{ - [securitySheet release]; securitySheet = nil; } diff --git a/Classes/LinphoneUI/UIToggleButton.m b/Classes/LinphoneUI/UIToggleButton.m index a8b92feab..7f75f3f95 100644 --- a/Classes/LinphoneUI/UIToggleButton.m +++ b/Classes/LinphoneUI/UIToggleButton.m @@ -53,9 +53,6 @@ return self; } -- (void)dealloc { - [super dealloc]; -} #pragma mark - diff --git a/Classes/LinphoneUI/UITransferButton.h b/Classes/LinphoneUI/UITransferButton.h index 451ff75d4..81455efe6 100644 --- a/Classes/LinphoneUI/UITransferButton.h +++ b/Classes/LinphoneUI/UITransferButton.h @@ -22,6 +22,6 @@ @interface UITransferButton : UIButton { } -@property (nonatomic, retain) IBOutlet UITextField* addressField; +@property (nonatomic, strong) IBOutlet UITextField* addressField; @end diff --git a/Classes/LinphoneUI/UITransferButton.m b/Classes/LinphoneUI/UITransferButton.m index 564e14a4f..6045e35e3 100644 --- a/Classes/LinphoneUI/UITransferButton.m +++ b/Classes/LinphoneUI/UITransferButton.m @@ -55,11 +55,6 @@ return self; } -- (void)dealloc { - [addressField release]; - - [super dealloc]; -} #pragma mark - diff --git a/Classes/LinphoneUI/UIVideoButton.h b/Classes/LinphoneUI/UIVideoButton.h index a7b4be5db..a4f8b3698 100644 --- a/Classes/LinphoneUI/UIVideoButton.h +++ b/Classes/LinphoneUI/UIVideoButton.h @@ -24,6 +24,6 @@ @interface UIVideoButton : UIToggleButton { } -@property (nonatomic, retain) IBOutlet UIActivityIndicatorView* waitView; +@property (nonatomic, strong) IBOutlet UIActivityIndicatorView* waitView; @end diff --git a/Classes/LinphoneUI/UIVideoButton.m b/Classes/LinphoneUI/UIVideoButton.m index 0a7bd358c..83dfa35d6 100644 --- a/Classes/LinphoneUI/UIVideoButton.m +++ b/Classes/LinphoneUI/UIVideoButton.m @@ -65,7 +65,7 @@ LinphoneCall* call = linphone_core_get_current_call([LinphoneManager getLc]); if (call) { - LinphoneCallAppData* callAppData = (LinphoneCallAppData*)linphone_call_get_user_pointer(call); + LinphoneCallAppData* callAppData = (__bridge LinphoneCallAppData*)linphone_call_get_user_pointer(call); callAppData->videoRequested=TRUE; /* will be used later to notify user if video was not activated because of the linphone core*/ LinphoneCallParams* call_params = linphone_call_params_copy(linphone_call_get_current_params(call)); linphone_call_params_enable_video(call_params, TRUE); @@ -120,9 +120,5 @@ return video_enabled; } -- (void)dealloc { - [waitView release]; - [super dealloc]; -} @end diff --git a/Classes/LinphoneUI/VideoZoomHandler.m b/Classes/LinphoneUI/VideoZoomHandler.m index 4cc86ba11..47facd68c 100644 --- a/Classes/LinphoneUI/VideoZoomHandler.m +++ b/Classes/LinphoneUI/VideoZoomHandler.m @@ -104,9 +104,6 @@ UIPinchGestureRecognizer* pinchReco = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(pinch:)]; [videoView addGestureRecognizer:pinchReco]; - [doubleFingerTap release]; - [pan release]; - [pinchReco release]; [self resetZoom]; } diff --git a/Classes/PhoneMainView.h b/Classes/PhoneMainView.h index 2816df501..6152b2a5c 100644 --- a/Classes/PhoneMainView.h +++ b/Classes/PhoneMainView.h @@ -48,9 +48,9 @@ @interface RootViewManager : NSObject -@property (nonatomic, retain) PhoneMainView* portraitViewController; -@property (nonatomic, retain) PhoneMainView* rotatingViewController; -@property (nonatomic, retain) NSMutableArray* viewDescriptionStack; +@property (nonatomic, strong) PhoneMainView* portraitViewController; +@property (nonatomic, strong) PhoneMainView* rotatingViewController; +@property (nonatomic, strong) NSMutableArray* viewDescriptionStack; +(RootViewManager*)instance; + (void)setupWithPortrait:(PhoneMainView*)portrait; @@ -63,12 +63,12 @@ NSMutableArray *inhibitedEvents; } -@property (nonatomic, retain) IBOutlet UIView *statusBarBG; -@property (nonatomic, retain) IBOutlet UICompositeViewController *mainViewController; +@property (nonatomic, strong) IBOutlet UIView *statusBarBG; +@property (nonatomic, strong) IBOutlet UICompositeViewController *mainViewController; -@property (nonatomic, retain) NSString* name; -@property (readonly) UICompositeViewDescription *currentView; -@property (readonly, retain) MPVolumeView* volumeView; +@property (nonatomic, strong) NSString* name; +@property (weak, readonly) UICompositeViewDescription *currentView; +@property (readonly, strong) MPVolumeView* volumeView; - (UIViewController*)changeCurrentView:(UICompositeViewDescription *)currentView; - (UIViewController*)changeCurrentView:(UICompositeViewDescription *)currentView push:(BOOL)push; diff --git a/Classes/PhoneMainView.m b/Classes/PhoneMainView.m index 47143ea8d..d5a9eeec8 100644 --- a/Classes/PhoneMainView.m +++ b/Classes/PhoneMainView.m @@ -42,7 +42,7 @@ static RootViewManager* rootViewManagerInstance = nil; self = [super init]; if ( self ){ self.portraitViewController = portrait; - self.rotatingViewController = [[[PhoneMainView alloc] init] autorelease]; + self.rotatingViewController = [[PhoneMainView alloc] init]; self.portraitViewController.name = @"Portrait"; self.rotatingViewController.name = @"Rotating"; @@ -146,10 +146,7 @@ static RootViewManager* rootViewManagerInstance = nil; - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; - [mainViewController release]; - [inhibitedEvents release]; - [super dealloc]; } @@ -292,7 +289,6 @@ static RootViewManager* rootViewManagerInstance = nil; cancelButtonTitle:NSLocalizedString(@"Continue",nil) otherButtonTitles:nil,nil]; [error show]; - [error release]; } } @@ -612,7 +608,7 @@ static RootViewManager* rootViewManagerInstance = nil; - (void)displayCallError:(LinphoneCall*) call message:(NSString*) message { const char* lUserNameChars=linphone_address_get_username(linphone_call_get_remote_address(call)); - NSString* lUserName = lUserNameChars?[[[NSString alloc] initWithUTF8String:lUserNameChars] autorelease]:NSLocalizedString(@"Unknown",nil); + NSString* lUserName = lUserNameChars?[[NSString alloc] initWithUTF8String:lUserNameChars]:NSLocalizedString(@"Unknown",nil); NSString* lMessage; NSString* lTitle; @@ -639,7 +635,6 @@ static RootViewManager* rootViewManagerInstance = nil; cancelButtonTitle:NSLocalizedString(@"Dismiss",nil) otherButtonTitles:nil]; [error show]; - [error release]; } - (void)addInhibitedEvent:(id)event { @@ -706,12 +701,12 @@ static RootViewManager* rootViewManagerInstance = nil; LinphoneCall* call = linphone_core_get_current_call([LinphoneManager getLc]); if (call && linphone_call_params_video_enabled(linphone_call_get_current_params(call))) { - LinphoneCallAppData* callData = (LinphoneCallAppData*) linphone_call_get_user_pointer(call); + LinphoneCallAppData* callData = (__bridge LinphoneCallAppData*) linphone_call_get_user_pointer(call); if(callData != nil) { if (state == UIDeviceBatteryStateUnplugged) { if (level <= 0.2f && !callData->batteryWarningShown) { LOGI(@"Battery warning"); - DTActionSheet *sheet = [[[DTActionSheet alloc] initWithTitle:NSLocalizedString(@"Battery is running low. Stop video ?",nil)] autorelease]; + DTActionSheet *sheet = [[DTActionSheet alloc] initWithTitle:NSLocalizedString(@"Battery is running low. Stop video ?",nil)]; [sheet addCancelButtonWithTitle:NSLocalizedString(@"Continue video", nil) block:nil]; [sheet addDestructiveButtonWithTitle:NSLocalizedString(@"Stop video", nil) block:^() { LinphoneCallParams* paramsCopy = linphone_call_params_copy(linphone_call_get_current_params(call)); diff --git a/Classes/SettingsViewController.h b/Classes/SettingsViewController.h index 91dd60905..ba88909ca 100644 --- a/Classes/SettingsViewController.h +++ b/Classes/SettingsViewController.h @@ -28,7 +28,7 @@ LinphoneCoreSettingsStore* settingsStore; } -@property (nonatomic, retain) IBOutlet UINavigationController *navigationController; -@property (nonatomic, retain) IBOutlet IASKAppSettingsViewController *settingsController; +@property (nonatomic, strong) IBOutlet UINavigationController *navigationController; +@property (nonatomic, strong) IBOutlet IASKAppSettingsViewController *settingsController; @end diff --git a/Classes/SettingsViewController.m b/Classes/SettingsViewController.m index 42c28edd4..440afdd38 100644 --- a/Classes/SettingsViewController.m +++ b/Classes/SettingsViewController.m @@ -57,7 +57,7 @@ NSString *_key; } -@property (nonatomic, retain) NSString *key; +@property (nonatomic, strong) NSString *key; @end @@ -66,9 +66,8 @@ @synthesize key=_key; - (void)dealloc { - [_key release], _key = nil; + _key = nil; - [super dealloc]; } @end @@ -115,7 +114,7 @@ UITableViewCell * cell = [super tableView:tableView cellForRowAtIndexPath:indexPath]; // Background View - UACellBackgroundView *selectedBackgroundView = [[[UACellBackgroundView alloc] initWithFrame:CGRectZero] autorelease]; + UACellBackgroundView *selectedBackgroundView = [[UACellBackgroundView alloc] initWithFrame:CGRectZero]; cell.selectedBackgroundView = selectedBackgroundView; [selectedBackgroundView setBackgroundColor:LINPHONE_TABLE_CELL_BACKGROUND_COLOR]; return cell; @@ -140,7 +139,7 @@ UITableViewCell *cell = nil; if ([identifier isEqualToString:kIASKPSToggleSwitchSpecifier]) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:kIASKPSToggleSwitchSpecifier]; - cell.accessoryView = [[[IASKSwitchEx alloc] initWithFrame:CGRectMake(0, 0, 79, 27)] autorelease]; + cell.accessoryView = [[IASKSwitchEx alloc] initWithFrame:CGRectMake(0, 0, 79, 27)]; [((IASKSwitchEx*)cell.accessoryView) addTarget:self action:@selector(toggledValue:) forControlEvents:UIControlEventValueChanged]; [((IASKSwitchEx*)cell.accessoryView) setOnTintColor:LINPHONE_MAIN_COLOR]; cell.selectionStyle = UITableViewCellSelectionStyleNone; @@ -153,7 +152,7 @@ } - (void)toggledValue:(id)sender { - IASKSwitchEx *toggle = [[(IASKSwitchEx*)sender retain] autorelease]; + IASKSwitchEx *toggle = (IASKSwitchEx*)sender; IASKSpecifier *spec = [_settingsReader specifierForKey:[toggle key]]; if ([toggle isOn]) { @@ -197,7 +196,6 @@ // add the new view controller to the dictionary and then to the 'viewList' array [newItemDict setObject:targetViewController forKey:@"viewController"]; [_viewList replaceObjectAtIndex:kIASKSpecifierValuesViewControllerIndex withObject:newItemDict]; - [targetViewController release]; } - (IASKSettingsReader*)settingsReader { @@ -250,7 +248,6 @@ UIBarButtonItem *buttonItem = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"About", nil) style:UIBarButtonItemStyleBordered target:self action:@selector(onAboutClick:)]; self.navigationItem.rightBarButtonItem = buttonItem; - [buttonItem release]; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { @@ -268,7 +265,7 @@ } // Background View - UACellBackgroundView *selectedBackgroundView = [[[UACellBackgroundView alloc] initWithFrame:CGRectZero] autorelease]; + UACellBackgroundView *selectedBackgroundView = [[UACellBackgroundView alloc] initWithFrame:CGRectZero]; cell.selectedBackgroundView = selectedBackgroundView; [selectedBackgroundView setBackgroundColor:LINPHONE_TABLE_CELL_BACKGROUND_COLOR]; return cell; @@ -365,7 +362,6 @@ labelTitleView.text = viewController.title; [labelTitleView sizeToFit]; viewController.navigationItem.titleView = labelTitleView; - [labelTitleView release]; [super pushViewController:viewController animated:animated]; } @@ -401,10 +397,6 @@ - (void)dealloc { // Remove all observer [[NSNotificationCenter defaultCenter] removeObserver:self]; - [settingsStore release]; - [settingsController release]; - [navigationController release]; - [super dealloc]; } #pragma mark - UICompositeViewDelegate Functions @@ -532,7 +524,7 @@ static UICompositeViewDescription *compositeDescription = nil; NSMutableArray *titles = [NSMutableArray arrayWithObjects:title, title, nil]; [dict setObject:titles forKey:kIASKTitles]; - return [[[IASKSpecifier alloc] initWithSpecifier:dict] autorelease]; + return [[IASKSpecifier alloc] initWithSpecifier:dict]; } + (IASKSpecifier*)filterSpecifier:(IASKSpecifier *)specifier { @@ -574,7 +566,7 @@ static UICompositeViewDescription *compositeDescription = nil; [values removeObject:@"DTLS"]; [dict setObject:values forKey:@"Values"]; } - return [[[IASKSpecifier alloc] initWithSpecifier:dict] autorelease]; + return [[IASKSpecifier alloc] initWithSpecifier:dict]; } #endif //HAVE_SSL @@ -732,7 +724,6 @@ static UICompositeViewDescription *compositeDescription = nil; cancelButtonTitle:NSLocalizedString(@"Cancel",nil) otherButtonTitles:NSLocalizedString(@"Launch Wizard",nil), nil]; [alert show]; - [alert release]; } else if ( [key isEqual:@"clear_proxy_button"] ) { if ( linphone_core_get_default_proxy_config(lc) == NULL ) { return; @@ -749,7 +740,6 @@ static UICompositeViewDescription *compositeDescription = nil; [settingsController.tableView reloadData]; }]; [alert show]; - [alert release]; } else if([key isEqual:@"about_button"]) { [[PhoneMainView instance] changeCurrentView:[AboutViewController compositeViewDescription] push:TRUE]; @@ -807,7 +797,6 @@ static UICompositeViewDescription *compositeDescription = nil; cancelButtonTitle:NSLocalizedString(@"Continue",nil) otherButtonTitles:nil]; [error show]; - [error release]; #else if ([MFMailComposeViewController canSendMail] == YES) { MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init]; diff --git a/Classes/Utils/CAAnimationBlocks/CAAnimation+Blocks.m b/Classes/Utils/CAAnimationBlocks/CAAnimation+Blocks.m index f6ce6c738..74566ced8 100755 --- a/Classes/Utils/CAAnimationBlocks/CAAnimation+Blocks.m +++ b/Classes/Utils/CAAnimationBlocks/CAAnimation+Blocks.m @@ -34,12 +34,6 @@ return self; } -- (void)dealloc -{ - self.completion = nil; - self.start = nil; - [super dealloc]; -} - (void)animationDidStart:(CAAnimation *)anim { @@ -69,7 +63,6 @@ CAAnimationDelegate *delegate = [[CAAnimationDelegate alloc] init]; delegate.completion = completion; self.delegate = delegate; - [delegate release]; } } @@ -87,7 +80,6 @@ CAAnimationDelegate *delegate = [[CAAnimationDelegate alloc] init]; delegate.start = start; self.delegate = delegate; - [delegate release]; } } diff --git a/Classes/Utils/DCRoundSwitch/DCRoundSwitch.h b/Classes/Utils/DCRoundSwitch/DCRoundSwitch.h index dd693de9e..4142fa2bd 100755 --- a/Classes/Utils/DCRoundSwitch/DCRoundSwitch.h +++ b/Classes/Utils/DCRoundSwitch/DCRoundSwitch.h @@ -18,7 +18,7 @@ @interface DCRoundSwitch : UIControl -@property (nonatomic, retain) UIColor *onTintColor; // default: blue (matches normal UISwitch) +@property (nonatomic, strong) UIColor *onTintColor; // default: blue (matches normal UISwitch) @property (nonatomic, getter=isOn) BOOL on; // default: NO @property (nonatomic, copy) NSString *onText; // default: 'ON' - automatically localized @property (nonatomic, copy) NSString *offText; // default: 'OFF' - automatically localized diff --git a/Classes/Utils/DCRoundSwitch/DCRoundSwitch.m b/Classes/Utils/DCRoundSwitch/DCRoundSwitch.m index 8e0549b27..d24a38f93 100755 --- a/Classes/Utils/DCRoundSwitch/DCRoundSwitch.m +++ b/Classes/Utils/DCRoundSwitch/DCRoundSwitch.m @@ -16,10 +16,10 @@ @interface DCRoundSwitch () -@property (nonatomic, retain) DCRoundSwitchOutlineLayer *outlineLayer; -@property (nonatomic, retain) DCRoundSwitchToggleLayer *toggleLayer; -@property (nonatomic, retain) DCRoundSwitchKnobLayer *knobLayer; -@property (nonatomic, retain) CAShapeLayer *clipLayer; +@property (nonatomic, strong) DCRoundSwitchOutlineLayer *outlineLayer; +@property (nonatomic, strong) DCRoundSwitchToggleLayer *toggleLayer; +@property (nonatomic, strong) DCRoundSwitchKnobLayer *knobLayer; +@property (nonatomic, strong) CAShapeLayer *clipLayer; @property (nonatomic, assign) BOOL ignoreTap; - (void)setup; @@ -37,19 +37,6 @@ #pragma mark - #pragma mark Init & Memory Managment -- (void)dealloc -{ - [outlineLayer release]; - [toggleLayer release]; - [knobLayer release]; - [clipLayer release]; - - [onTintColor release]; - [onText release]; - [offText release]; - - [super dealloc]; -} - (id)init { @@ -129,7 +116,7 @@ // this is the knob, and sits on top of the layer stack. note that the knob shadow is NOT drawn here, it is drawn on the // toggleLayer so it doesn't bleed out over the outlineLayer. - self.toggleLayer = [[[[[self class] toggleLayerClass] alloc] initWithOnString:self.onText offString:self.offText onTintColor:[UIColor colorWithRed:0.000 green:0.478 blue:0.882 alpha:1.0]] autorelease]; + self.toggleLayer = [[[[self class] toggleLayerClass] alloc] initWithOnString:self.onText offString:self.offText onTintColor:[UIColor colorWithRed:0.000 green:0.478 blue:0.882 alpha:1.0]]; self.toggleLayer.drawOnTint = NO; self.toggleLayer.clip = YES; [self.layer addSublayer:self.toggleLayer]; @@ -146,14 +133,14 @@ self.toggleLayer.contentsScale = self.outlineLayer.contentsScale = self.knobLayer.contentsScale = [[UIScreen mainScreen] scale]; // tap gesture for toggling the switch - UITapGestureRecognizer *tapGestureRecognizer = [[[UITapGestureRecognizer alloc] initWithTarget:self - action:@selector(tapped:)] autorelease]; + UITapGestureRecognizer *tapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self + action:@selector(tapped:)]; [tapGestureRecognizer setDelegate:self]; [self addGestureRecognizer:tapGestureRecognizer]; // pan gesture for moving the switch knob manually - UIPanGestureRecognizer *panGestureRecognizer = [[[UIPanGestureRecognizer alloc] initWithTarget:self - action:@selector(toggleDragged:)] autorelease]; + UIPanGestureRecognizer *panGestureRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self + action:@selector(toggleDragged:)]; [panGestureRecognizer setDelegate:self]; [self addGestureRecognizer:panGestureRecognizer]; @@ -353,7 +340,6 @@ [self positionLayersAndMask]; // retain all our targets so they don't disappear before the actions get sent at the end of the animation - [[self allTargets] makeObjectsPerformSelector:@selector(retain)]; [CATransaction setCompletionBlock:^{ [CATransaction begin]; @@ -399,7 +385,6 @@ if (previousOn != on && !ignoreControlEvents) [self sendActionsForControlEvents:UIControlEventValueChanged]; - [[self allTargets] makeObjectsPerformSelector:@selector(release)]; }]; [CATransaction commit]; @@ -410,8 +395,7 @@ { if (anOnTintColor != onTintColor) { - [onTintColor release]; - onTintColor = [anOnTintColor retain]; + onTintColor = anOnTintColor; self.toggleLayer.onTintColor = anOnTintColor; [self.toggleLayer setNeedsDisplay]; } @@ -447,7 +431,6 @@ { if (newOnText != onText) { - [onText release]; onText = [newOnText copy]; self.toggleLayer.onString = onText; [self.toggleLayer setNeedsDisplay]; @@ -458,7 +441,6 @@ { if (newOffText != offText) { - [offText release]; offText = [newOffText copy]; self.toggleLayer.offString = offText; [self.toggleLayer setNeedsDisplay]; diff --git a/Classes/Utils/DCRoundSwitch/DCRoundSwitchToggleLayer.h b/Classes/Utils/DCRoundSwitch/DCRoundSwitchToggleLayer.h index e56c631b9..b7c39cfe4 100755 --- a/Classes/Utils/DCRoundSwitch/DCRoundSwitchToggleLayer.h +++ b/Classes/Utils/DCRoundSwitch/DCRoundSwitchToggleLayer.h @@ -14,10 +14,10 @@ @interface DCRoundSwitchToggleLayer : CALayer -@property (nonatomic, retain) UIColor *onTintColor; -@property (nonatomic, retain) NSString *onString; -@property (nonatomic, retain) NSString *offString; -@property (nonatomic, readonly) UIFont *labelFont; +@property (nonatomic, strong) UIColor *onTintColor; +@property (nonatomic, strong) NSString *onString; +@property (nonatomic, strong) NSString *offString; +@property (weak, nonatomic, readonly) UIFont *labelFont; @property (nonatomic) BOOL drawOnTint; @property (nonatomic) BOOL clip; diff --git a/Classes/Utils/DCRoundSwitch/DCRoundSwitchToggleLayer.m b/Classes/Utils/DCRoundSwitch/DCRoundSwitchToggleLayer.m index 99e0550bf..4c884b6f6 100755 --- a/Classes/Utils/DCRoundSwitch/DCRoundSwitchToggleLayer.m +++ b/Classes/Utils/DCRoundSwitch/DCRoundSwitchToggleLayer.m @@ -17,14 +17,6 @@ @synthesize clip; @synthesize labelFont; -- (void)dealloc -{ - [onString release]; - [offString release]; - [onTintColor release]; - - [super dealloc]; -} - (id)initWithOnString:(NSString *)anOnString offString:(NSString *)anOffString onTintColor:(UIColor *)anOnTintColor { diff --git a/Classes/Utils/DTFoundation/DTActionSheet.m b/Classes/Utils/DTFoundation/DTActionSheet.m index ca43272ec..ae091c824 100755 --- a/Classes/Utils/DTFoundation/DTActionSheet.m +++ b/Classes/Utils/DTFoundation/DTActionSheet.m @@ -71,7 +71,6 @@ { [super setDelegate:nil]; self.actionSheetDelegate = nil; - [super dealloc]; } - (NSInteger)addButtonWithTitle:(NSString *)title block:(DTActionSheetBlock)block diff --git a/Classes/Utils/DTFoundation/DTAlertView.m b/Classes/Utils/DTFoundation/DTAlertView.m index 58fdd1e8f..9bf0211f1 100644 --- a/Classes/Utils/DTFoundation/DTAlertView.m +++ b/Classes/Utils/DTFoundation/DTAlertView.m @@ -23,7 +23,6 @@ { [super setDelegate:nil]; self.alertViewDelegate = nil; - [super dealloc]; } // designated initializer diff --git a/Classes/Utils/FastAddressBook.m b/Classes/Utils/FastAddressBook.m index 042839cd1..c1455cfd9 100644 --- a/Classes/Utils/FastAddressBook.m +++ b/Classes/Utils/FastAddressBook.m @@ -27,11 +27,7 @@ static void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef inf + (NSString*)getContactDisplayName:(ABRecordRef)contact { NSString *retString = nil; if (contact) { - CFStringRef lDisplayName = ABRecordCopyCompositeName(contact); - if(lDisplayName != NULL) { - retString = [NSString stringWithString:(NSString*)lDisplayName]; - CFRelease(lDisplayName); - } + retString = CFBridgingRelease(ABRecordCopyCompositeName(contact)); } return retString; } @@ -71,10 +67,7 @@ static void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef inf CFDataRef imgData = ABPersonCopyImageDataWithFormat(contact, thumbnail? kABPersonImageFormatThumbnail: kABPersonImageFormatOriginalSize); - retImage = [UIImage imageWithData:(NSData *)imgData]; - if(imgData != NULL) { - CFRelease(imgData); - } + retImage = [UIImage imageWithData:(NSData *)CFBridgingRelease(imgData)]; if (retImage != nil && retImage.size.width != retImage.size.height) { LOGI(@"Image is not square : cropping it."); @@ -87,7 +80,7 @@ static void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef inf - (ABRecordRef)getContact:(NSString*)address { @synchronized (addressBookMap){ - return (ABRecordRef)[addressBookMap objectForKey:address]; + return (__bridge ABRecordRef)[addressBookMap objectForKey:address]; } } @@ -163,8 +156,7 @@ static void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef inf - (void)saveAddressBook { if( addressBook != nil ){ - NSError* err = nil; - if( !ABAddressBookSave(addressBook, (CFErrorRef*)err) ){ + if( !ABAddressBookSave(addressBook, nil) ){ LOGW(@"Couldn't save Address Book"); } } @@ -172,7 +164,7 @@ static void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef inf - (void)reload { if(addressBook != nil) { - ABAddressBookUnregisterExternalChangeCallback(addressBook, sync_address_book, self); + ABAddressBookUnregisterExternalChangeCallback(addressBook, sync_address_book, (__bridge void *)(self)); CFRelease(addressBook); addressBook = nil; } @@ -181,7 +173,7 @@ static void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef inf addressBook = ABAddressBookCreateWithOptions(NULL, NULL); if(addressBook != NULL) { ABAddressBookRequestAccessWithCompletion(addressBook, ^(bool granted, CFErrorRef error) { - ABAddressBookRegisterExternalChangeCallback (addressBook, sync_address_book, self); + ABAddressBookRegisterExternalChangeCallback (addressBook, sync_address_book, (__bridge void *)(self)); [self loadData]; }); } else { @@ -194,23 +186,18 @@ static void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef inf @synchronized (addressBookMap) { [addressBookMap removeAllObjects]; - NSArray *lContacts = (NSArray *)ABAddressBookCopyArrayOfAllPeople(addressBook); + NSArray *lContacts = (NSArray *)CFBridgingRelease(ABAddressBookCopyArrayOfAllPeople(addressBook)); for (id lPerson in lContacts) { // Phone { - ABMultiValueRef lMap = ABRecordCopyValue((ABRecordRef)lPerson, kABPersonPhoneProperty); + ABMultiValueRef lMap = ABRecordCopyValue((__bridge ABRecordRef)lPerson, kABPersonPhoneProperty); if(lMap) { for (int i=0; i { - id _delegate; + id __weak _delegate; NSMutableArray *_viewList; @@ -76,11 +76,11 @@ NSSet *_hiddenKeys; } -@property (nonatomic, assign) IBOutlet id delegate; +@property (nonatomic, weak) IBOutlet id delegate; @property (nonatomic, copy) NSString *file; @property (nonatomic, assign) BOOL showCreditsFooter; @property (nonatomic, assign) BOOL showDoneButton; -@property (nonatomic, retain) NSSet *hiddenKeys; +@property (nonatomic, strong) NSSet *hiddenKeys; - (void)synchronizeSettings; - (void)dismiss:(id)sender; diff --git a/Classes/Utils/InAppSettingsKit/Controllers/IASKAppSettingsViewController.m b/Classes/Utils/InAppSettingsKit/Controllers/IASKAppSettingsViewController.m index da7395b1a..8f101232d 100755 --- a/Classes/Utils/InAppSettingsKit/Controllers/IASKAppSettingsViewController.m +++ b/Classes/Utils/InAppSettingsKit/Controllers/IASKAppSettingsViewController.m @@ -41,8 +41,8 @@ static NSString *kIASKCredits = @"Powered by InAppSettingsKit"; // Leave this as CGRect IASKCGRectSwap(CGRect rect); @interface IASKAppSettingsViewController () -@property (nonatomic, retain) NSMutableArray *viewList; -@property (nonatomic, retain) id currentFirstResponder; +@property (nonatomic, strong) NSMutableArray *viewList; +@property (nonatomic, strong) id currentFirstResponder; - (void)_textChanged:(id)sender; - (void)synchronizeSettings; @@ -81,19 +81,18 @@ CGRect IASKCGRectSwap(CGRect rect); if (!_file) { return @"Root"; } - return [[_file retain] autorelease]; + return _file; } - (void)setFile:(NSString *)file { if (file != _file) { - [_file release]; _file = [file copy]; } self.tableView.contentOffset = CGPointMake(0, 0); self.settingsReader = nil; // automatically initializes itself - [_hiddenKeys release], _hiddenKeys = nil; + _hiddenKeys = nil; [self.tableView reloadData]; } @@ -138,7 +137,7 @@ CGRect IASKCGRectSwap(CGRect rect); - (id)initWithCoder:(NSCoder *)aDecoder { self = [super initWithCoder:aDecoder]; if (self) { - [self initWithStyle:UITableViewStyleGrouped]; + if (!(self = [self initWithStyle:UITableViewStyleGrouped])) return nil; } return self; } @@ -164,7 +163,6 @@ CGRect IASKCGRectSwap(CGRect rect); UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(singleTapToEndEdit:)]; tapGesture.cancelsTouchesInView = NO; [self.tableView addGestureRecognizer:tapGesture]; - [tapGesture release]; } - (void)viewDidUnload { @@ -193,7 +191,6 @@ CGRect IASKCGRectSwap(CGRect rect); target:self action:@selector(dismiss:)]; self.navigationItem.rightBarButtonItem = buttonItem; - [buttonItem release]; } if (!self.title) { self.title = NSLocalizedString(@"Settings", @""); @@ -255,7 +252,7 @@ CGRect IASKCGRectSwap(CGRect rect); - (void)setHiddenKeys:(NSSet*)theHiddenKeys animated:(BOOL)animated { if (_hiddenKeys != theHiddenKeys) { NSSet *oldHiddenKeys = _hiddenKeys; - _hiddenKeys = [theHiddenKeys retain]; + _hiddenKeys = theHiddenKeys; if (animated) { [self.tableView beginUpdates]; @@ -326,7 +323,6 @@ CGRect IASKCGRectSwap(CGRect rect); self.settingsReader.hiddenKeys = theHiddenKeys; [self.tableView reloadData]; } - [oldHiddenKeys release]; IASKAppSettingsViewController *targetViewController = [[self.viewList objectAtIndex:kIASKSpecifierChildViewControllerIndex] objectForKey:@"viewController"]; if(targetViewController != nil) { @@ -339,16 +335,15 @@ CGRect IASKCGRectSwap(CGRect rect); - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; - [_viewList release], _viewList = nil; - [_file release], _file = nil; - [_currentFirstResponder release], _currentFirstResponder = nil; - [_settingsReader release], _settingsReader = nil; - [_settingsStore release], _settingsStore = nil; - [_hiddenKeys release], _hiddenKeys = nil; + _viewList = nil; + _file = nil; + _currentFirstResponder = nil; + _settingsReader = nil; + _settingsStore = nil; + _hiddenKeys = nil; _delegate = nil; - [super dealloc]; } @@ -364,7 +359,7 @@ CGRect IASKCGRectSwap(CGRect rect); } - (void)toggledValue:(id)sender { - IASKSwitch *toggle = [[(IASKSwitch*)sender retain] autorelease]; + IASKSwitch *toggle = (IASKSwitch*)sender; IASKSpecifier *spec = [_settingsReader specifierForKey:[toggle key]]; if ([toggle isOn]) { @@ -390,7 +385,7 @@ CGRect IASKCGRectSwap(CGRect rect); } - (void)sliderChangedValue:(id)sender { - IASKSlider *slider = [[(IASKSlider*)sender retain] autorelease]; + IASKSlider *slider = (IASKSlider*)sender; [self.settingsStore setFloat:[slider value] forKey:[slider key]]; [[NSNotificationCenter defaultCenter] postNotificationName:kIASKAppSettingChanged object:[slider key] @@ -480,7 +475,7 @@ CGRect IASKCGRectSwap(CGRect rect); UITableViewCell *cell = nil; if ([identifier isEqualToString:kIASKPSToggleSwitchSpecifier]) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:kIASKPSToggleSwitchSpecifier]; - cell.accessoryView = [[[IASKSwitch alloc] initWithFrame:CGRectMake(0, 0, 79, 27)] autorelease]; + cell.accessoryView = [[IASKSwitch alloc] initWithFrame:CGRectMake(0, 0, 79, 27)]; [((IASKSwitch*)cell.accessoryView) addTarget:self action:@selector(toggledValue:) forControlEvents:UIControlEventValueChanged]; cell.selectionStyle = UITableViewCellSelectionStyleNone; } @@ -518,7 +513,7 @@ CGRect IASKCGRectSwap(CGRect rect); UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:specifier.type]; if(nil == cell) { - cell = [[self newCellForIdentifier:specifier.type] autorelease]; + cell = [self newCellForIdentifier:specifier.type]; } if ([specifier.type isEqualToString:kIASKPSToggleSwitchSpecifier]) { @@ -627,7 +622,7 @@ CGRect IASKCGRectSwap(CGRect rect); //create a set of specifier types that can't be selected static NSSet* noSelectionTypes = nil; if(nil == noSelectionTypes) { - noSelectionTypes = [[NSSet setWithObjects:kIASKPSToggleSwitchSpecifier, kIASKPSSliderSpecifier, nil] retain]; + noSelectionTypes = [NSSet setWithObjects:kIASKPSToggleSwitchSpecifier, kIASKPSSliderSpecifier, nil]; } IASKSpecifier *specifier = [self.settingsReader specifierForIndexPath:indexPath]; @@ -658,7 +653,6 @@ CGRect IASKCGRectSwap(CGRect rect); // add the new view controller to the dictionary and then to the 'viewList' array [newItemDict setObject:targetViewController forKey:@"viewController"]; [self.viewList replaceObjectAtIndex:kIASKSpecifierValuesViewControllerIndex withObject:newItemDict]; - [targetViewController release]; // load the view controll back in to push it targetViewController = [[self.viewList objectAtIndex:kIASKSpecifierValuesViewControllerIndex] objectForKey:@"viewController"]; @@ -681,8 +675,11 @@ CGRect IASKCGRectSwap(CGRect rect); if (!initSelector) { initSelector = @selector(init); } - UIViewController * vc = [vcClass performSelector:@selector(alloc)]; - [vc performSelector:initSelector withObject:[specifier file] withObject:[specifier key]]; + UIViewController * vc = [vcClass alloc]; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Warc-performSelector-leaks" + vc = [vc performSelector:initSelector withObject:[specifier file] withObject:specifier]; +#pragma clang diagnostic pop if ([vc respondsToSelector:@selector(setDelegate:)]) { [vc performSelector:@selector(setDelegate:) withObject:self.delegate]; } @@ -690,7 +687,6 @@ CGRect IASKCGRectSwap(CGRect rect); [vc performSelector:@selector(setSettingsStore:) withObject:self.settingsStore]; } [self.navigationController pushViewController:vc animated:YES]; - [vc performSelector:@selector(release)]; return; } @@ -715,7 +711,6 @@ CGRect IASKCGRectSwap(CGRect rect); // add the new view controller to the dictionary and then to the 'viewList' array [newItemDict setObject:targetViewController forKey:@"viewController"]; [self.viewList replaceObjectAtIndex:kIASKSpecifierChildViewControllerIndex withObject:newItemDict]; - [targetViewController release]; // load the view controll back in to push it targetViewController = [[self.viewList objectAtIndex:kIASKSpecifierChildViewControllerIndex] objectForKey:@"viewController"]; @@ -742,7 +737,10 @@ CGRect IASKCGRectSwap(CGRect rect); Class buttonClass = [specifier buttonClass]; SEL buttonAction = [specifier buttonAction]; if ([buttonClass respondsToSelector:buttonAction]) { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Warc-performSelector-leaks" [buttonClass performSelector:buttonAction withObject:self withObject:[specifier key]]; +#pragma clang diagnostic pop NSLog(@"InAppSettingsKit Warning: Using IASKButtonSpecifier without implementing the delegate method is deprecated"); } } @@ -792,7 +790,6 @@ CGRect IASKCGRectSwap(CGRect rect); mailViewController.mailComposeDelegate = vc; [vc presentModalViewController:mailViewController animated:YES]; - [mailViewController release]; } else { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Mail not configured", @"InAppSettingsKit") @@ -801,7 +798,6 @@ CGRect IASKCGRectSwap(CGRect rect); cancelButtonTitle:NSLocalizedString(@"OK", @"InAppSettingsKit") otherButtonTitles:nil]; [alert show]; - [alert release]; } } else if ([[specifier type] isEqualToString:kIASKCustomViewSpecifier] && [self.delegate respondsToSelector:@selector(settingsViewController:tableView:didSelectCustomViewSpecifier:)]) { @@ -838,7 +834,7 @@ CGRect IASKCGRectSwap(CGRect rect); } - (void)_textChanged:(id)sender { - IASKTextField *text = [[(IASKTextField*)sender retain] autorelease]; + IASKTextField *text = (IASKTextField*)sender; [_settingsStore setObject:[text text] forKey:[text key]]; [[NSNotificationCenter defaultCenter] postNotificationName:kIASKAppSettingChanged object:[text key] @@ -874,7 +870,7 @@ static NSDictionary *oldUserDefaults = nil; } } } - [oldUserDefaults release], oldUserDefaults = [currentDict retain]; + oldUserDefaults = currentDict; for (UITableViewCell *cell in self.tableView.visibleCells) { diff --git a/Classes/Utils/InAppSettingsKit/Controllers/IASKAppSettingsWebViewController.h b/Classes/Utils/InAppSettingsKit/Controllers/IASKAppSettingsWebViewController.h index 4805ddf3c..5afcb8c04 100755 --- a/Classes/Utils/InAppSettingsKit/Controllers/IASKAppSettingsWebViewController.h +++ b/Classes/Utils/InAppSettingsKit/Controllers/IASKAppSettingsWebViewController.h @@ -24,7 +24,7 @@ - (id)initWithFile:(NSString*)htmlFileName key:(NSString*)key; -@property (nonatomic, retain) UIWebView *webView; -@property (nonatomic, retain) NSURL *url; +@property (nonatomic, strong) UIWebView *webView; +@property (nonatomic, strong) NSURL *url; @end diff --git a/Classes/Utils/InAppSettingsKit/Controllers/IASKAppSettingsWebViewController.m b/Classes/Utils/InAppSettingsKit/Controllers/IASKAppSettingsWebViewController.m index feb95ddc9..9c49d86b8 100755 --- a/Classes/Utils/InAppSettingsKit/Controllers/IASKAppSettingsWebViewController.m +++ b/Classes/Utils/InAppSettingsKit/Controllers/IASKAppSettingsWebViewController.m @@ -47,10 +47,9 @@ } - (void)dealloc { - [webView release], webView = nil; - [url release], url = nil; + webView = nil; + url = nil; - [super dealloc]; } - (void)viewWillAppear:(BOOL)animated { @@ -102,11 +101,10 @@ NSString *key = [[keyValue objectAtIndex:0] lowercaseString]; NSString *value = [keyValue objectAtIndex:1]; - value = (NSString *)CFURLCreateStringByReplacingPercentEscapesUsingEncoding(kCFAllocatorDefault, + value = (NSString *)CFBridgingRelease(CFURLCreateStringByReplacingPercentEscapesUsingEncoding(kCFAllocatorDefault, (CFStringRef)value, CFSTR(""), - kCFStringEncodingUTF8); - [value autorelease]; + kCFStringEncodingUTF8)); if ([key isEqualToString:@"subject"]) { [mailViewController setSubject:value]; @@ -135,7 +133,6 @@ [mailViewController setToRecipients:toRecipients]; [self presentModalViewController:mailViewController animated:YES]; - [mailViewController release]; return NO; } diff --git a/Classes/Utils/InAppSettingsKit/Controllers/IASKSpecifierValuesViewController.h b/Classes/Utils/InAppSettingsKit/Controllers/IASKSpecifierValuesViewController.h index 85f6d9fc2..5f48fab6f 100755 --- a/Classes/Utils/InAppSettingsKit/Controllers/IASKSpecifierValuesViewController.h +++ b/Classes/Utils/InAppSettingsKit/Controllers/IASKSpecifierValuesViewController.h @@ -29,8 +29,8 @@ id _settingsStore; } -@property (nonatomic, retain) UITableView *tableView; -@property (nonatomic, retain) NSIndexPath *checkedItem; -@property (nonatomic, retain) IASKSpecifier *currentSpecifier; +@property (nonatomic, strong) UITableView *tableView; +@property (nonatomic, strong) NSIndexPath *checkedItem; +@property (nonatomic, strong) IASKSpecifier *currentSpecifier; @end diff --git a/Classes/Utils/InAppSettingsKit/Controllers/IASKSpecifierValuesViewController.m b/Classes/Utils/InAppSettingsKit/Controllers/IASKSpecifierValuesViewController.m index bd0b82ac6..6e1791aec 100755 --- a/Classes/Utils/InAppSettingsKit/Controllers/IASKSpecifierValuesViewController.m +++ b/Classes/Utils/InAppSettingsKit/Controllers/IASKSpecifierValuesViewController.m @@ -112,12 +112,11 @@ - (void)dealloc { - [_currentSpecifier release], _currentSpecifier = nil; - [_checkedItem release], _checkedItem = nil; - [_settingsReader release], _settingsReader = nil; - [_settingsStore release], _settingsStore = nil; - [_tableView release], _tableView = nil; - [super dealloc]; + _currentSpecifier = nil; + _checkedItem = nil; + _settingsReader = nil; + _settingsStore = nil; + _tableView = nil; } @@ -151,7 +150,7 @@ NSArray *titles = [_currentSpecifier multipleTitles]; if (!cell) { - cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:kCellValue] autorelease]; + cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:kCellValue]; } if ([indexPath isEqual:[self checkedItem]]) { @@ -197,7 +196,7 @@ #pragma mark Notifications - (void)userDefaultsDidChange { - NSIndexPath *oldCheckedItem = [[self.checkedItem retain] autorelease]; + NSIndexPath *oldCheckedItem = self.checkedItem; if(_currentSpecifier) { [self updateCheckedItem]; } diff --git a/Classes/Utils/InAppSettingsKit/Models/IASKSettingsReader.h b/Classes/Utils/InAppSettingsKit/Models/IASKSettingsReader.h index a05ddb202..643024b41 100755 --- a/Classes/Utils/InAppSettingsKit/Models/IASKSettingsReader.h +++ b/Classes/Utils/InAppSettingsKit/Models/IASKSettingsReader.h @@ -152,11 +152,11 @@ __VA_ARGS__ \ - (NSString*)titleForStringId:(NSString*)stringId; - (NSString*)pathForImageNamed:(NSString*)image; -@property (nonatomic, retain) NSString *path; -@property (nonatomic, retain) NSString *localizationTable; -@property (nonatomic, retain) NSString *bundlePath; -@property (nonatomic, retain) NSDictionary *settingsBundle; -@property (nonatomic, retain) NSArray *dataSource; -@property (nonatomic, retain) NSSet *hiddenKeys; +@property (nonatomic, strong) NSString *path; +@property (nonatomic, strong) NSString *localizationTable; +@property (nonatomic, strong) NSString *bundlePath; +@property (nonatomic, strong) NSDictionary *settingsBundle; +@property (nonatomic, strong) NSArray *dataSource; +@property (nonatomic, strong) NSSet *hiddenKeys; @end diff --git a/Classes/Utils/InAppSettingsKit/Models/IASKSettingsReader.m b/Classes/Utils/InAppSettingsKit/Models/IASKSettingsReader.m index 7e15fce1e..991621e1d 100755 --- a/Classes/Utils/InAppSettingsKit/Models/IASKSettingsReader.m +++ b/Classes/Utils/InAppSettingsKit/Models/IASKSettingsReader.m @@ -45,7 +45,7 @@ hiddenKeys = _hiddenKeys; self.path = [self locateSettingsFile: file]; [self setSettingsBundle:[NSDictionary dictionaryWithContentsOfFile:self.path]]; self.bundlePath = [self.path stringByDeletingLastPathComponent]; - _bundle = [[NSBundle bundleWithPath:[self bundlePath]] retain]; + _bundle = [NSBundle bundleWithPath:[self bundlePath]]; // Look for localization file self.localizationTable = [self.settingsBundle objectForKey:@"StringsTable"]; @@ -70,23 +70,20 @@ hiddenKeys = _hiddenKeys; } - (void)dealloc { - [_path release], _path = nil; - [_localizationTable release], _localizationTable = nil; - [_bundlePath release], _bundlePath = nil; - [_settingsBundle release], _settingsBundle = nil; - [_dataSource release], _dataSource = nil; - [_bundle release], _bundle = nil; - [_hiddenKeys release], _hiddenKeys = nil; + _path = nil; + _localizationTable = nil; + _bundlePath = nil; + _settingsBundle = nil; + _dataSource = nil; + _bundle = nil; + _hiddenKeys = nil; - [super dealloc]; } - (void)setHiddenKeys:(NSSet *)anHiddenKeys { if (_hiddenKeys != anHiddenKeys) { - id old = _hiddenKeys; - _hiddenKeys = [anHiddenKeys retain]; - [old release]; + _hiddenKeys = anHiddenKeys; if (_settingsBundle) { [self _reinterpretBundle:_settingsBundle]; @@ -98,7 +95,7 @@ hiddenKeys = _hiddenKeys; - (void)_reinterpretBundle:(NSDictionary*)settingsBundle { NSArray *preferenceSpecifiers = [settingsBundle objectForKey:kIASKPreferenceSpecifiers]; NSInteger sectionCount = -1; - NSMutableArray *dataSource = [[[NSMutableArray alloc] init] autorelease]; + NSMutableArray *dataSource = [[NSMutableArray alloc] init]; for (NSDictionary *specifier in preferenceSpecifiers) { if ([self.hiddenKeys containsObject:[specifier objectForKey:kIASKKey]]) { @@ -109,20 +106,17 @@ hiddenKeys = _hiddenKeys; [newArray addObject:specifier]; [dataSource addObject:newArray]; - [newArray release]; sectionCount++; } else { if (sectionCount == -1) { NSMutableArray *newArray = [[NSMutableArray alloc] init]; [dataSource addObject:newArray]; - [newArray release]; sectionCount++; } IASKSpecifier *newSpecifier = [[IASKSpecifier alloc] initWithSpecifier:specifier]; [(NSMutableArray*)[dataSource objectAtIndex:sectionCount] addObject:newSpecifier]; - [newSpecifier release]; } } [self setDataSource:dataSource]; diff --git a/Classes/Utils/InAppSettingsKit/Models/IASKSettingsStoreFile.m b/Classes/Utils/InAppSettingsKit/Models/IASKSettingsStoreFile.m index 104642d7e..793af1326 100755 --- a/Classes/Utils/InAppSettingsKit/Models/IASKSettingsStoreFile.m +++ b/Classes/Utils/InAppSettingsKit/Models/IASKSettingsStoreFile.m @@ -22,7 +22,7 @@ - (id)initWithPath:(NSString*)path { if((self = [super init])) { - _filePath = [path retain]; + _filePath = path; _dict = [[NSMutableDictionary alloc] initWithContentsOfFile:path]; if(_dict == nil) { _dict = [[NSMutableDictionary alloc] init]; @@ -32,10 +32,9 @@ } - (void)dealloc { - [_dict release], _dict = nil; - [_filePath release], _filePath = nil; + _dict = nil; + _filePath = nil; - [super dealloc]; } diff --git a/Classes/Utils/InAppSettingsKit/Models/IASKSpecifier.h b/Classes/Utils/InAppSettingsKit/Models/IASKSpecifier.h index 5eeec3596..131352104 100755 --- a/Classes/Utils/InAppSettingsKit/Models/IASKSpecifier.h +++ b/Classes/Utils/InAppSettingsKit/Models/IASKSpecifier.h @@ -22,10 +22,10 @@ @interface IASKSpecifier : NSObject { NSDictionary *_specifierDict; NSDictionary *_multipleValuesDict; - IASKSettingsReader *_settingsReader; + IASKSettingsReader *__weak _settingsReader; } -@property (nonatomic, retain) NSDictionary *specifierDict; -@property (nonatomic, assign) IASKSettingsReader *settingsReader; +@property (nonatomic, strong) NSDictionary *specifierDict; +@property (nonatomic, weak) IASKSettingsReader *settingsReader; - (id)initWithSpecifier:(NSDictionary*)specifier; - (NSString*)localizedObjectForKey:(NSString*)key; diff --git a/Classes/Utils/InAppSettingsKit/Models/IASKSpecifier.m b/Classes/Utils/InAppSettingsKit/Models/IASKSpecifier.m index d76beb4ab..9a4f7b338 100755 --- a/Classes/Utils/InAppSettingsKit/Models/IASKSpecifier.m +++ b/Classes/Utils/InAppSettingsKit/Models/IASKSpecifier.m @@ -18,7 +18,7 @@ #import "IASKSettingsReader.h" @interface IASKSpecifier () -@property (nonatomic, retain) NSDictionary *multipleValuesDict; +@property (nonatomic, strong) NSDictionary *multipleValuesDict; - (void)_reinterpretValues:(NSDictionary*)specifierDict; @end @@ -41,19 +41,18 @@ } - (void)dealloc { - [_specifierDict release], _specifierDict = nil; - [_multipleValuesDict release], _multipleValuesDict = nil; + _specifierDict = nil; + _multipleValuesDict = nil; _settingsReader = nil; - [super dealloc]; } - (void)_reinterpretValues:(NSDictionary*)specifierDict { NSArray *values = [_specifierDict objectForKey:kIASKValues]; NSArray *titles = [_specifierDict objectForKey:kIASKTitles]; - NSMutableDictionary *multipleValuesDict = [[[NSMutableDictionary alloc] init] autorelease]; + NSMutableDictionary *multipleValuesDict = [[NSMutableDictionary alloc] init]; if (values) { [multipleValuesDict setObject:values forKey:kIASKValues]; diff --git a/Classes/Utils/InAppSettingsKit/Views/IASKPSSliderSpecifierViewCell.h b/Classes/Utils/InAppSettingsKit/Views/IASKPSSliderSpecifierViewCell.h index 1aca0cfe1..680da08fa 100755 --- a/Classes/Utils/InAppSettingsKit/Views/IASKPSSliderSpecifierViewCell.h +++ b/Classes/Utils/InAppSettingsKit/Views/IASKPSSliderSpecifierViewCell.h @@ -18,14 +18,10 @@ @class IASKSlider; -@interface IASKPSSliderSpecifierViewCell : UITableViewCell { - IASKSlider *_slider; - UIImageView *_minImage; - UIImageView *_maxImage; -} +@interface IASKPSSliderSpecifierViewCell : UITableViewCell -@property (nonatomic, assign) IASKSlider *slider; -@property (nonatomic, assign) UIImageView *minImage; -@property (nonatomic, assign) UIImageView *maxImage; +@property (nonatomic, strong) IASKSlider *slider; +@property (nonatomic, strong) UIImageView *minImage; +@property (nonatomic, strong) UIImageView *maxImage; @end diff --git a/Classes/Utils/InAppSettingsKit/Views/IASKPSSliderSpecifierViewCell.m b/Classes/Utils/InAppSettingsKit/Views/IASKPSSliderSpecifierViewCell.m index dc2130d85..28032dbee 100755 --- a/Classes/Utils/InAppSettingsKit/Views/IASKPSSliderSpecifierViewCell.m +++ b/Classes/Utils/InAppSettingsKit/Views/IASKPSSliderSpecifierViewCell.m @@ -19,31 +19,26 @@ #import "IASKSettingsReader.h" @implementation IASKPSSliderSpecifierViewCell - -@synthesize slider=_slider, - minImage=_minImage, - maxImage=_maxImage; - - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; if (self) { // Setting only frame data that will not be overwritten by layoutSubviews // Slider - _slider = [[[IASKSlider alloc] initWithFrame:CGRectMake(0, 0, 0, 23)] autorelease]; + _slider = [[IASKSlider alloc] initWithFrame:CGRectMake(0, 0, 0, 23)]; _slider.autoresizingMask = UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleWidth; _slider.continuous = NO; [self.contentView addSubview:_slider]; // MinImage - _minImage = [[[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 21, 21)] autorelease]; + _minImage = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 21, 21)]; _minImage.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleBottomMargin; [self.contentView addSubview:_minImage]; // MaxImage - _maxImage = [[[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 21, 21)] autorelease]; + _maxImage = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 21, 21)]; _maxImage.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleBottomMargin; [self.contentView addSubview:_maxImage]; @@ -90,7 +85,6 @@ - (void)dealloc { _minImage.image = nil; _maxImage.image = nil; - [super dealloc]; } - (void)prepareForReuse { diff --git a/Classes/Utils/InAppSettingsKit/Views/IASKPSTextFieldSpecifierViewCell.h b/Classes/Utils/InAppSettingsKit/Views/IASKPSTextFieldSpecifierViewCell.h index 16b90ed94..9e3a1d574 100755 --- a/Classes/Utils/InAppSettingsKit/Views/IASKPSTextFieldSpecifierViewCell.h +++ b/Classes/Utils/InAppSettingsKit/Views/IASKPSTextFieldSpecifierViewCell.h @@ -18,10 +18,8 @@ @class IASKTextField; -@interface IASKPSTextFieldSpecifierViewCell : UITableViewCell { - IASKTextField *_textField; -} +@interface IASKPSTextFieldSpecifierViewCell : UITableViewCell -@property (nonatomic, assign) IASKTextField *textField; +@property (nonatomic, strong) IASKTextField *textField; @end diff --git a/Classes/Utils/InAppSettingsKit/Views/IASKPSTextFieldSpecifierViewCell.m b/Classes/Utils/InAppSettingsKit/Views/IASKPSTextFieldSpecifierViewCell.m index e2db77660..f3b5baacf 100755 --- a/Classes/Utils/InAppSettingsKit/Views/IASKPSTextFieldSpecifierViewCell.m +++ b/Classes/Utils/InAppSettingsKit/Views/IASKPSTextFieldSpecifierViewCell.m @@ -29,7 +29,7 @@ self.textLabel.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleRightMargin; // TextField - _textField = [[[IASKTextField alloc] initWithFrame:CGRectMake(0, 0, 200, 21)] autorelease]; + _textField = [[IASKTextField alloc] initWithFrame:CGRectMake(0, 0, 200, 21)]; _textField.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleLeftMargin; @@ -69,9 +69,6 @@ } -- (void)dealloc { - [super dealloc]; -} @end diff --git a/Classes/Utils/InAppSettingsKit/Views/IASKSlider.h b/Classes/Utils/InAppSettingsKit/Views/IASKSlider.h index 34c5ecbbe..59236e0ef 100755 --- a/Classes/Utils/InAppSettingsKit/Views/IASKSlider.h +++ b/Classes/Utils/InAppSettingsKit/Views/IASKSlider.h @@ -21,6 +21,6 @@ NSString *_key; } -@property (nonatomic, retain) NSString *key; +@property (nonatomic, strong) NSString *key; @end diff --git a/Classes/Utils/InAppSettingsKit/Views/IASKSlider.m b/Classes/Utils/InAppSettingsKit/Views/IASKSlider.m index d591ff298..4c91bb0f8 100755 --- a/Classes/Utils/InAppSettingsKit/Views/IASKSlider.m +++ b/Classes/Utils/InAppSettingsKit/Views/IASKSlider.m @@ -22,9 +22,8 @@ @synthesize key=_key; - (void)dealloc { - [_key release], _key = nil; + _key = nil; - [super dealloc]; } @end diff --git a/Classes/Utils/InAppSettingsKit/Views/IASKSwitch.h b/Classes/Utils/InAppSettingsKit/Views/IASKSwitch.h index b1439bd1c..e9d529cb7 100755 --- a/Classes/Utils/InAppSettingsKit/Views/IASKSwitch.h +++ b/Classes/Utils/InAppSettingsKit/Views/IASKSwitch.h @@ -21,6 +21,6 @@ NSString *_key; } -@property (nonatomic, retain) NSString *key; +@property (nonatomic, strong) NSString *key; @end diff --git a/Classes/Utils/InAppSettingsKit/Views/IASKSwitch.m b/Classes/Utils/InAppSettingsKit/Views/IASKSwitch.m index f32aba4d3..c23f380a0 100755 --- a/Classes/Utils/InAppSettingsKit/Views/IASKSwitch.m +++ b/Classes/Utils/InAppSettingsKit/Views/IASKSwitch.m @@ -22,9 +22,8 @@ @synthesize key=_key; - (void)dealloc { - [_key release], _key = nil; + _key = nil; - [super dealloc]; } diff --git a/Classes/Utils/InAppSettingsKit/Views/IASKTextField.h b/Classes/Utils/InAppSettingsKit/Views/IASKTextField.h index 47c9be375..bbddd9f62 100755 --- a/Classes/Utils/InAppSettingsKit/Views/IASKTextField.h +++ b/Classes/Utils/InAppSettingsKit/Views/IASKTextField.h @@ -21,6 +21,6 @@ NSString *_key; } -@property (nonatomic, retain) NSString *key; +@property (nonatomic, strong) NSString *key; @end diff --git a/Classes/Utils/InAppSettingsKit/Views/IASKTextField.m b/Classes/Utils/InAppSettingsKit/Views/IASKTextField.m index 9056896f4..9debccf4a 100755 --- a/Classes/Utils/InAppSettingsKit/Views/IASKTextField.m +++ b/Classes/Utils/InAppSettingsKit/Views/IASKTextField.m @@ -22,9 +22,8 @@ @synthesize key=_key; - (void)dealloc { - [_key release], _key = nil; + _key = nil; - [super dealloc]; } @end diff --git a/Classes/Utils/OrderedDictionary.m b/Classes/Utils/OrderedDictionary.m index 0d6683e8a..55cfd00c3 100644 --- a/Classes/Utils/OrderedDictionary.m +++ b/Classes/Utils/OrderedDictionary.m @@ -28,7 +28,7 @@ NSString *DescriptionForObject(NSObject *object, id locale, NSUInteger indent) NSString *objectString; if ([object isKindOfClass:[NSString class]]) { - objectString = (NSString *)[[object retain] autorelease]; + objectString = (NSString *)object; } else if ([object respondsToSelector:@selector(descriptionWithLocale:indent:)]) { @@ -70,12 +70,6 @@ NSString *DescriptionForObject(NSObject *object, id locale, NSUInteger indent) return self; } -- (void)dealloc -{ - [dictionary release]; - [array release]; - [super dealloc]; -} - (id)copy { @@ -126,8 +120,11 @@ NSString *DescriptionForObject(NSObject *object, id locale, NSUInteger indent) [self removeObjectForKey:aKey]; } NSUInteger anIndex; + IMP imp = [aKey methodForSelector:comparator]; + NSComparisonResult (*func)(id, SEL, id) = (void *)imp; + for(anIndex = 0; anIndex < [array count]; ++anIndex) { - NSComparisonResult result = (NSComparisonResult) [aKey performSelector:comparator withObject:[array objectAtIndex: anIndex]]; + NSComparisonResult result = (NSComparisonResult) func(aKey, comparator, [array objectAtIndex: anIndex]); if(result <= 0) { break; } diff --git a/Classes/Utils/TPMultiLayoutViewController/TPMultiLayoutViewController.h b/Classes/Utils/TPMultiLayoutViewController/TPMultiLayoutViewController.h index 460480c33..65ed235d0 100755 --- a/Classes/Utils/TPMultiLayoutViewController/TPMultiLayoutViewController.h +++ b/Classes/Utils/TPMultiLayoutViewController/TPMultiLayoutViewController.h @@ -20,8 +20,8 @@ // Call directly to use with custom animation (override willRotateToInterfaceOrientation to disable the switch there) - (void)applyLayoutForInterfaceOrientation:(UIInterfaceOrientation)newOrientation; -@property (nonatomic, retain) IBOutlet UIView *landscapeView; -@property (nonatomic, retain) IBOutlet UIView *portraitView; +@property (nonatomic, strong) IBOutlet UIView *landscapeView; +@property (nonatomic, strong) IBOutlet UIView *portraitView; @property (assign) BOOL viewIsCurrentlyPortrait; @end diff --git a/Classes/Utils/TPMultiLayoutViewController/TPMultiLayoutViewController.m b/Classes/Utils/TPMultiLayoutViewController/TPMultiLayoutViewController.m index 668e0d747..afcc338ce 100755 --- a/Classes/Utils/TPMultiLayoutViewController/TPMultiLayoutViewController.m +++ b/Classes/Utils/TPMultiLayoutViewController/TPMultiLayoutViewController.m @@ -28,8 +28,8 @@ [super viewDidLoad]; // Construct attribute tables - portraitAttributes = [[self attributeTableForViewHierarchy:portraitView associateWithViewHierarchy:self.view] retain]; - landscapeAttributes = [[self attributeTableForViewHierarchy:landscapeView associateWithViewHierarchy:self.view] retain]; + portraitAttributes = [self attributeTableForViewHierarchy:portraitView associateWithViewHierarchy:self.view]; + landscapeAttributes = [self attributeTableForViewHierarchy:landscapeView associateWithViewHierarchy:self.view]; viewIsCurrentlyPortrait = (self.view == portraitView); // Don't need to retain the original template view hierarchies any more @@ -40,19 +40,14 @@ - (void)viewDidUnload { [super viewDidUnload]; - [portraitAttributes release]; portraitAttributes = nil; - [landscapeAttributes release]; landscapeAttributes = nil; } - (void)dealloc { - [portraitAttributes release]; portraitAttributes = nil; - [landscapeAttributes release]; landscapeAttributes = nil; - [super dealloc]; } - (void)viewWillAppear:(BOOL)animated { @@ -89,7 +84,7 @@ } - (void)addAttributesForSubviewHierarchy:(UIView*)view associatedWithSubviewHierarchy:(UIView*)associatedView toTable:(NSMutableDictionary*)table { - [table setObject:[self attributesForView:view] forKey:[NSValue valueWithPointer:associatedView]]; + [table setObject:[self attributesForView:view] forKey:[NSValue valueWithPointer:(__bridge const void *)(associatedView)]]; if ( ![self shouldDescendIntoSubviewsOfView:view] ) return; @@ -189,7 +184,7 @@ } - (void)applyAttributeTable:(NSDictionary*)table toViewHierarchy:(UIView*)view { - NSDictionary *attributes = [table objectForKey:[NSValue valueWithPointer:view]]; + NSDictionary *attributes = [table objectForKey:[NSValue valueWithPointer:(__bridge const void *)(view)]]; if ( attributes ) { [self applyAttributes:attributes toView:view]; } diff --git a/Classes/Utils/UACellBackgroundView/UACellBackgroundView.m b/Classes/Utils/UACellBackgroundView/UACellBackgroundView.m index 82a9671ed..871876da0 100644 --- a/Classes/Utils/UACellBackgroundView/UACellBackgroundView.m +++ b/Classes/Utils/UACellBackgroundView/UACellBackgroundView.m @@ -57,17 +57,11 @@ static void addRoundedRectToPath(CGContextRef context, CGRect rect, float ovalWi } - (void)setBackgroundColor:(UIColor *)abackgroundColor { - if(backgroundColor != nil) { - [backgroundColor release]; - } backgroundColor = [[UIColor alloc] initWithCGColor:abackgroundColor.CGColor]; [self setNeedsDisplay]; } - (void)setBorderColor:(UIColor *)aborderColor { - if(borderColor != nil) { - [borderColor release]; - } borderColor = [[UIColor alloc] initWithCGColor:aborderColor.CGColor]; [self setNeedsDisplay]; @@ -246,10 +240,6 @@ static void addRoundedRectToPath(CGContextRef context, CGRect rect, float ovalWi return; } -- (void)dealloc { - [backgroundColor release]; - [super dealloc]; -} - (void)setPosition:(UACellBackgroundViewPosition)newPosition { if (position != newPosition) { diff --git a/Classes/Utils/Utils.m b/Classes/Utils/Utils.m index 061e4dbe3..c9d56d7d1 100644 --- a/Classes/Utils/Utils.m +++ b/Classes/Utils/Utils.m @@ -40,7 +40,6 @@ ortp_severity = ORTP_FATAL; } ortp_log(ortp_severity, "%*s:%3d - %s", filesize, file+MAX((int)strlen(file)-filesize,0), line, [str UTF8String]); - [str release]; } + (void)log:(LinphoneLoggerSeverity) severity file:(const char*)file line:(int)line format:(NSString *)format,... { diff --git a/Classes/WizardViewController.h b/Classes/WizardViewController.h index 7b853f5a0..35a97b423 100644 --- a/Classes/WizardViewController.h +++ b/Classes/WizardViewController.h @@ -37,39 +37,39 @@ NSMutableArray *historyViews; } -@property (nonatomic, retain) IBOutlet UIScrollView *contentView; +@property (nonatomic, strong) IBOutlet UIScrollView *contentView; -@property (nonatomic, retain) IBOutlet UIView *welcomeView; -@property (nonatomic, retain) IBOutlet UIView *choiceView; -@property (nonatomic, retain) IBOutlet UIView *createAccountView; -@property (nonatomic, retain) IBOutlet UIView *connectAccountView; -@property (nonatomic, retain) IBOutlet UIView *externalAccountView; -@property (nonatomic, retain) IBOutlet UIView *validateAccountView; -@property (retain, nonatomic) IBOutlet UIView *provisionedAccountView; +@property (nonatomic, strong) IBOutlet UIView *welcomeView; +@property (nonatomic, strong) IBOutlet UIView *choiceView; +@property (nonatomic, strong) IBOutlet UIView *createAccountView; +@property (nonatomic, strong) IBOutlet UIView *connectAccountView; +@property (nonatomic, strong) IBOutlet UIView *externalAccountView; +@property (nonatomic, strong) IBOutlet UIView *validateAccountView; +@property (strong, nonatomic) IBOutlet UIView *provisionedAccountView; -@property (nonatomic, retain) IBOutlet UIView *waitView; +@property (nonatomic, strong) IBOutlet UIView *waitView; -@property (nonatomic, retain) IBOutlet UIButton *backButton; -@property (nonatomic, retain) IBOutlet UIButton *startButton; -@property (nonatomic, retain) IBOutlet UIButton *createAccountButton; -@property (nonatomic, retain) IBOutlet UIButton *connectAccountButton; -@property (nonatomic, retain) IBOutlet UIButton *externalAccountButton; -@property (retain, nonatomic) IBOutlet UIButton *remoteProvisioningButton; -@property (retain, nonatomic) IBOutlet UILinphoneButton *registerButton; -@property (retain, nonatomic) IBOutlet UILinphoneButton *purchaseButton; +@property (nonatomic, strong) IBOutlet UIButton *backButton; +@property (nonatomic, strong) IBOutlet UIButton *startButton; +@property (nonatomic, strong) IBOutlet UIButton *createAccountButton; +@property (nonatomic, strong) IBOutlet UIButton *connectAccountButton; +@property (nonatomic, strong) IBOutlet UIButton *externalAccountButton; +@property (strong, nonatomic) IBOutlet UIButton *remoteProvisioningButton; +@property (strong, nonatomic) IBOutlet UILinphoneButton *registerButton; +@property (strong, nonatomic) IBOutlet UILinphoneButton *purchaseButton; -@property (retain, nonatomic) IBOutlet UILinphoneTextField *createAccountUsername; -@property (retain, nonatomic) IBOutlet UILinphoneTextField *connectAccountUsername; -@property (retain, nonatomic) IBOutlet UILinphoneTextField *externalAccountUsername; +@property (strong, nonatomic) IBOutlet UILinphoneTextField *createAccountUsername; +@property (strong, nonatomic) IBOutlet UILinphoneTextField *connectAccountUsername; +@property (strong, nonatomic) IBOutlet UILinphoneTextField *externalAccountUsername; -@property (retain, nonatomic) IBOutlet UITextField *provisionedUsername; -@property (retain, nonatomic) IBOutlet UITextField *provisionedPassword; -@property (retain, nonatomic) IBOutlet UITextField *provisionedDomain; +@property (strong, nonatomic) IBOutlet UITextField *provisionedUsername; +@property (strong, nonatomic) IBOutlet UITextField *provisionedPassword; +@property (strong, nonatomic) IBOutlet UITextField *provisionedDomain; -@property (nonatomic, retain) IBOutlet UIImageView *choiceViewLogoImageView; -@property (retain, nonatomic) IBOutlet UISegmentedControl *transportChooser; +@property (nonatomic, strong) IBOutlet UIImageView *choiceViewLogoImageView; +@property (strong, nonatomic) IBOutlet UISegmentedControl *transportChooser; -@property (nonatomic, retain) IBOutlet UITapGestureRecognizer *viewTapGestureRecognizer; +@property (nonatomic, strong) IBOutlet UITapGestureRecognizer *viewTapGestureRecognizer; - (void)reset; - (void)fillDefaultValues; diff --git a/Classes/WizardViewController.m b/Classes/WizardViewController.m index 874aa2094..4b2250d9e 100644 --- a/Classes/WizardViewController.m +++ b/Classes/WizardViewController.m @@ -86,44 +86,16 @@ typedef enum _ViewElement { - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; - [contentView release]; - [welcomeView release]; - [choiceView release]; - [createAccountView release]; - [connectAccountView release]; - [externalAccountView release]; - [validateAccountView release]; - [waitView release]; - [backButton release]; - [startButton release]; - [createAccountButton release]; - [connectAccountButton release]; - [externalAccountButton release]; - [choiceViewLogoImageView release]; - [historyViews release]; - [viewTapGestureRecognizer release]; - [remoteProvisioningButton release]; - [provisionedAccountView release]; - [provisionedUsername release]; - [provisionedPassword release]; - [provisionedDomain release]; - [_transportChooser release]; - [_createAccountUsername release]; - [_connectAccountUsername release]; - [_externalAccountUsername release]; - [_purchaseButton release]; - [_registerButton release]; - [super dealloc]; } @@ -509,7 +481,6 @@ static UICompositeViewDescription *compositeDescription = nil; cancelButtonTitle:NSLocalizedString(@"Continue",nil) otherButtonTitles:nil,nil]; [errorView show]; - [errorView release]; return FALSE; } @@ -588,7 +559,6 @@ static UICompositeViewDescription *compositeDescription = nil; XMLRPCConnectionManager *manager = [XMLRPCConnectionManager sharedManager]; [manager spawnConnectionWithXMLRPCRequest: request delegate: self]; - [request release]; [waitView setHidden:false]; } @@ -603,7 +573,6 @@ static UICompositeViewDescription *compositeDescription = nil; XMLRPCConnectionManager *manager = [XMLRPCConnectionManager sharedManager]; [manager spawnConnectionWithXMLRPCRequest: request delegate: self]; - [request release]; [waitView setHidden:false]; } @@ -617,7 +586,6 @@ static UICompositeViewDescription *compositeDescription = nil; XMLRPCConnectionManager *manager = [XMLRPCConnectionManager sharedManager]; [manager spawnConnectionWithXMLRPCRequest: request delegate: self]; - [request release]; [waitView setHidden:false]; } @@ -643,7 +611,6 @@ static UICompositeViewDescription *compositeDescription = nil; cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alert show]; - [alert release]; break; } case LinphoneRegistrationProgress: { @@ -783,7 +750,6 @@ static UICompositeViewDescription *compositeDescription = nil; prov_url.placeholder = @"URL"; [remoteInput show]; - [remoteInput release]; } - (BOOL) verificationWithUsername:(NSString*)username password:(NSString*)password domain:(NSString*)domain withTransport:(NSString*)transport { @@ -803,7 +769,6 @@ static UICompositeViewDescription *compositeDescription = nil; cancelButtonTitle:NSLocalizedString(@"Continue",nil) otherButtonTitles:nil,nil]; [errorView show]; - [errorView release]; return FALSE; } return TRUE; @@ -878,7 +843,6 @@ static UICompositeViewDescription *compositeDescription = nil; cancelButtonTitle:NSLocalizedString(@"Continue",nil) otherButtonTitles:nil,nil]; [errorView show]; - [errorView release]; return FALSE; } @@ -956,7 +920,6 @@ static UICompositeViewDescription *compositeDescription = nil; cancelButtonTitle:NSLocalizedString(@"Continue",nil) otherButtonTitles:nil,nil]; [errorView show]; - [errorView release]; } else { [self.waitView setHidden:false]; [self addProvisionedProxy:username withPassword:password withDomain:provisionedDomain.text]; @@ -1011,7 +974,6 @@ static UICompositeViewDescription *compositeDescription = nil; cancelButtonTitle:NSLocalizedString(@"OK", nil) otherButtonTitles: nil]; [alert show]; - [alert release]; break; } @@ -1102,7 +1064,6 @@ static UICompositeViewDescription *compositeDescription = nil; cancelButtonTitle:NSLocalizedString(@"Continue",nil) otherButtonTitles:nil,nil]; [errorView show]; - [errorView release]; } else if([response object] != nil) { //Don't handle if not object: HTTP/Communication Error if([[request method] isEqualToString:@"check_account"]) { if([response object] == [NSNumber numberWithInt:1]) { @@ -1112,7 +1073,6 @@ static UICompositeViewDescription *compositeDescription = nil; cancelButtonTitle:NSLocalizedString(@"Continue",nil) otherButtonTitles:nil,nil]; [errorView show]; - [errorView release]; } else { NSString *username = [WizardViewController findTextField:ViewElement_Username view:contentView].text; NSString *password = [WizardViewController findTextField:ViewElement_Password view:contentView].text; @@ -1134,7 +1094,6 @@ static UICompositeViewDescription *compositeDescription = nil; cancelButtonTitle:NSLocalizedString(@"Continue",nil) otherButtonTitles:nil,nil]; [errorView show]; - [errorView release]; } } else if([[request method] isEqualToString:@"check_account_validated"]) { if([response object] == [NSNumber numberWithInt:1]) { @@ -1148,7 +1107,6 @@ static UICompositeViewDescription *compositeDescription = nil; cancelButtonTitle:NSLocalizedString(@"Continue",nil) otherButtonTitles:nil,nil]; [errorView show]; - [errorView release]; } } } @@ -1162,7 +1120,6 @@ static UICompositeViewDescription *compositeDescription = nil; cancelButtonTitle:NSLocalizedString(@"Continue", nil) otherButtonTitles:nil,nil]; [errorView show]; - [errorView release]; [waitView setHidden:true]; } diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index ce6c4f90c..18e4888cd 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -4562,6 +4562,7 @@ ARCHS = "$(ARCHS_STANDARD)"; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_UNREACHABLE_CODE = NO; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -4649,6 +4650,7 @@ ARCHS = "$(ARCHS_STANDARD)"; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_UNREACHABLE_CODE = NO; CODE_SIGN_ENTITLEMENTS = ""; CODE_SIGN_IDENTITY = "iPhone Developer"; @@ -4736,6 +4738,7 @@ ARCHS = "$(ARCHS_STANDARD)"; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_UNREACHABLE_CODE = NO; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -4821,6 +4824,7 @@ ARCHS = "$(ARCHS_STANDARD)"; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_UNREACHABLE_CODE = NO; CODE_SIGN_ENTITLEMENTS = ""; CODE_SIGN_IDENTITY = "iPhone Developer"; diff --git a/main.m b/main.m index 26996ff51..37ed74ae1 100644 --- a/main.m +++ b/main.m @@ -35,8 +35,8 @@ int main(int argc, char *argv[]) { #ifdef DEBUG NSSetUncaughtExceptionHandler(&uncaughtExceptionHandler); #endif - NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; - int retVal = UIApplicationMain(argc, argv, nil, NSStringFromClass([LinphoneAppDelegate class])); - [pool release]; - return retVal; + @autoreleasepool { + int retVal = UIApplicationMain(argc, argv, nil, NSStringFromClass([LinphoneAppDelegate class])); + return retVal; + } }