Friday, September 30, 2011

Convert NSString to NSDate


    NSString *dateString = @"03-Sep-11";

    NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init]   autorelease];
    dateFormatter.dateFormat = @"dd-MMM-yy";

    NSDate *date = [dateFormatter dateFromString:dateString];

Thursday, September 29, 2011

Add Background Image (UIImage) To UIView


//To add a image as background for an UIView (Make sure the image is in your app’s resource bundle)
         
      - (void)viewDidLoad
      {
          self.view.backgroundColor = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"bgImage.png"]];
      }

xCode iOS: Set Status Bar Color and Background


User can put this code or in AppDelegate file as this will be called once in Application /Or as per requirements.

UIApplication Class
Set one of the following as per your choice:

[[UIApplication sharedApplication]
      setStatusBarStyle:UIStatusBarStyleBlackTranslucent animated:NO];
[[UIApplication sharedApplication]
      setStatusBarStyle:UIStatusBarStyleBlackOpaque animated:NO];
[[UIApplication sharedApplication]
      setStatusBarStyle:UIStatusBarStyleDefault animated:NO];

Tuesday, September 6, 2011

Difference Between @synthesize and @dynamic

//@synthesize will generate getter and setter methods for your property. @dynamic just tells the compiler that the getter and setter methods are implemented not by the class itself but somewhere else (like the superclass)

//@dynamic e.g. with subclasses of NSManagedObject (CoreData) or when you want to create an outlet for a property defined by a superclass that was not defined as an outlet:



//Super class:

@property (nonatomic, retain) NSButton *someButton;

@synthesize someButton;



//Subclass:

@property (nonatomic, retain) IBOutlet NSButton *someButton;

@dynamic someButton;

Friday, September 2, 2011

Apple Launched Mac OS X Lion

Apple has released Mac OS X Lion on its Mac App Store and, as promised, the new operating system is selling for $31.99. But if you have purchased macbook after july 2011 you can update from Apple free. for more details you can check Apple's web site, if this offer is sill open.

Mac OS X Lion (version 10.7) is the eighth major release of Mac OS X, Apple's desktop and server operating system for Macintosh computers. Lion was released on July 20, 2011, as announced during Apple's third quarter 2011 earnings report. Apple's homepage and Mac OS X webpages refer to it as OS X Lion, without the "Mac", although Apple's press release for Lion's July release mainly uses "Mac OS X Lion" rather than "OS X Lion". Built on a rock-solid UNIX foundation, OS X is engineered to take full advantage of the technologies in every new Mac. And to deliver the most intuitive and integrated computer experience.

There's no going into an Apple store and buying a copy of this new OS for Intel-based Apple laptops and desktops on a DVD. Apple provides thumb drive as well for OS X Lion. Mac OS X Lion - which touts more than 250 new features - is only available as a 3.49-gigabyte digital download. Apple store employees will, however, help with downloading Lion for those who stroll in.

Since the company that makes the Mac creates the software on every Mac, you get a fully integrated system in which everything works together perfectly. OS X works with the processor in your Mac to deliver the best possible performance. The Multi-Touch track pad on every Mac notebook gives you more than enough space to pinch, swipe, and tap your way around most of the apps on your system. OS X gives you long battery life by dimming the screen in low-light conditions and even regulating processor activity between keystrokes.

Among the new features Lion is adding over its predecessor, OS X Snow Leopard, are new multi-touch track-pad features, including scrolling speed that varies depending on how fast you flick your fingers, pinching your fingers to zoom in on a web page or image and new security features such as stepped-up hard drive encryption.

Apple will ship OS X Lion exclusively via the Mac App Store next month. The company has posted an extensive list of 250 new features and improvements within the OS. We've found some more information, including clarification that previous concerns are answered by news it will be possible to download OS X Lion from the Mac App Store just once in order to upgrade large numbers of Macs.

Quick Overview of Mac features:

There are approx. 250 new features in Mac OS X Lion few of those are
Multi-Touch Gestures
Full-screen apps
Mission Control
Language Support
Launchpad etc.
MAC OS X LION will automatically saves your changes as you go, so you never have to worry about losing work. Also will keeps history of your document as you work & presents.