RSS

Database migration with application update example

DbMigration

 
Leave a comment

Posted by on December 22, 2014 in Uncategorized

 

Appirater

Appirater

 
Leave a comment

Posted by on December 17, 2014 in Uncategorized

 

Sort mutable array containing dictionary

NSComparator compareDistances = ^(id string1, id string2)
{
NSNumber *number1 = [NSNumber numberWithFloat:[string1 floatValue]];
NSNumber *number2 = [NSNumber numberWithFloat:[string2 floatValue]];

return [number1 compare:number2];
};

// sort list and create nearest list
NSSortDescriptor *sortDescriptorNearest = [NSSortDescriptor sortDescriptorWithKey:@”petrolStation.pointCoordinates.distance” ascending:YES comparator:compareDistances];
_nearestList = (NSMutableArray *)[_gasStations sortedArrayUsingDescriptors:@[sortDescriptorNearest]];

 
Leave a comment

Posted by on December 16, 2014 in Uncategorized

 

UIActivityViewcontroller example for sharing like photo gallary

UIActivityViewController

– (IBAction)sendPost:(id)sender {
NSArray *activityItems;

if (_postImage.image != nil) {
activityItems = @[_postText.text, _postImage.image];
} else {
activityItems = @[_postText.text];
}

UIActivityViewController *activityController =
[[UIActivityViewController alloc]
initWithActivityItems:activityItems
applicationActivities:nil];

[self presentViewController:activityController
animated:YES completion:nil];
}

 
Leave a comment

Posted by on December 15, 2014 in Uncategorized

 

iOS NSString and NSData encryption and decryption example link

FBEncryptor

 
Leave a comment

Posted by on November 26, 2014 in Uncategorized

 

iOS 8 APNS Token registration method changed

– (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
{
//– Set Notification
if ([application respondsToSelector:@selector(isRegisteredForRemoteNotifications)])
{
// iOS 8 Notifications
[application registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]];

[application registerForRemoteNotifications];
}
else
{
// iOS < 8 Notifications
[application registerForRemoteNotificationTypes:
(UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert)];
}

//— your custom code
return YES;
}

 
Leave a comment

Posted by on October 8, 2014 in Uncategorized

 

Simple Delegate example for beginner

Delegate Example

 
Leave a comment

Posted by on September 16, 2014 in Uncategorized