[Objective-C] Get current Date and Time

Get current and formatted time from your simulator or device!

[code lang=”java” autolinks=”false” collapse=”false” firstline=”1″ gutter=”true” htmlscript=”false” light=”false” padlinenumbers=”false” smarttabs=”true” tabsize=”4″ toolbar=”false”]- (NSString*) getDateTime {
     NSDateFormatter *formatter;
     NSString        *dateString;
 
     formatter = [[NSDateFormatter alloc] init];
     [formatter setDateFormat:@"dd-MM-yyyy HH:mm"];
 
     dateString = [formatter stringFromDate:[NSDate date]];
     [formatter release];

     NSLog(@"Current data: %@", dateString);
     return dateString;
}[/code]

eof

Rif: albertopasca.it

[Objective-C] Add contact to contacts list

Hi all,
this is a simple way to add programmatically a “Person” into your iphone contacts list.

First of all you need to include Address Book frameworks into your project:

#import AddressBook/AddressBook.h
#import AddressBookUI/AddressBookUI.h

Continue reading “[Objective-C] Add contact to contacts list”

[WP7] Open Url with Internet Explorer

How to call Internet Explorer to open a custom url!

[code lang=”csharp” autolinks=”false” collapse=”false” firstline=”1″ gutter=”true” htmlscript=”false” light=”false” padlinenumbers=”false” smarttabs=”true” tabsize=”4″ toolbar=”false”]WebBrowserTask ie = new WebBrowserTask();
ie.URL = "http://www.albertopasca.it";
ie.Show();[/code]