RSS

Monthly Archives: July 2012

Create Buttons for iOS Application

Button Factory

 
Leave a comment

Posted by on July 27, 2012 in Uncategorized

 

UIFrameWork Extractor Amazing Example

UIFrameWork Extractor Link

 
Leave a comment

Posted by on July 27, 2012 in Uncategorized

 

Enable APNS in iOS Code for Objective C Developer

Hello Friend ,here is the code for APNS , you need to use mobile-provisioning file with APNS enable AppID.
and you need to pass device token to backend side and webservice will automatically push notification to the device , which device register their device token to that werbservice.

All code you need to put into appdelegate.m file :

1 ) [[UIApplication sharedApplication] registerForRemoteNotificationTypes: UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert];

put this code in didfinishlaunching method of your AppDelegate.m file.

2 ) now you need to copy and paste below three function to your AppDelegate.m file , and your work is over ūüôā

– (void)application:(UIApplication *)app didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)devToken {
   tokenAsString = [[[[devToken description]
¬† ¬† ¬† ¬† ¬† ¬† ¬† ¬† ¬† ¬† ¬† stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@””]]
¬† ¬† ¬† ¬† ¬† ¬† ¬† ¬† ¬† ¬† ¬†stringByReplacingOccurrencesOfString:@” ” withString:@””] copy];
   deviceToken = [[NSString stringWithString:tokenAsString] retain];
¬† ¬†NSLog(@”\n DeviceToken :%@”,deviceToken);
[18/07/12 1:40:17 PM] deval chauhan: }

this function gives you device token in nsstring format , you need to pass this to backend side using webservice.

– (void)application:(UIApplication *)app didFailToRegisterForRemoteNotificationsWithError:(NSError *)error {
¬† ¬†UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@”Error in didFailToRegisterForRemoteNotificationsWithError !” message:[NSString stringWithFormat:@”%@”,error] delegate:self cancelButtonTitle:@”ok” otherButtonTitles:nil];
   [alert show];
   [alert release];
}
– (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo{
   
¬† ¬†UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@”VG 2013″ message:[NSString stringWithFormat:@”%@”,[[userInfo valueForKey:@”aps”] valueForKey:@”alert”]] delegate:self cancelButtonTitle:@”ok” otherButtonTitles:nil];
   [alert show];
   [alert release];
}

this both function handles your notification massages and errors automatically.

you need to take care about mobile-provisioning files.

 
Leave a comment

Posted by on July 18, 2012 in Uncategorized

 

Read and Write with NSUserDefault

Hello Friends , here going to put code for read and write with NSUserDefaults for my beginner Friends ūüôā

NSUserDefaults stores data in dictionary format , you can set value for key and retrive that value through same key.

Code for Set Value in NSUserDefault :

NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];

[defaults setObject:@”deval Chauhan” forKey:@”Username”];

[defaults setObject:@”developer” forKey:@”Password”];

 

Code to Retrive value from NSUserDefault :

NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];

NSString *username =¬†[defaults objectForKey:@”Username”];

NSString *Password =¬†[defaults objectForKey:@”Password”];

 
Leave a comment

Posted by on July 17, 2012 in Uncategorized

 

AdMob iOS Usefull Tutorial Link

AdMob UseFull Tutorial

 
Leave a comment

Posted by on July 12, 2012 in Uncategorized

 

iOS and Call History usefull tutorial URL

iOS Call History Tutorial

 
Leave a comment

Posted by on July 7, 2012 in Uncategorized

 

How to Parse XML file and Database operation (function)

NSXMLParser and database function is ready at below link.

Stackoverflow link for NSXMLParser and Database Operation

 
Leave a comment

Posted by on July 2, 2012 in Uncategorized