Skip to main content

Posts

Showing posts from 2012

iOS Dev: Orientation Notification

 Here Code: /********************************* Notification For Orientation ***************************************/ #pragma mark - Orientation Notification #pragma mark callNotification -( void )changeOrientationsNotification{          [[ UIDevice   currentDevice ]  beginGeneratingDeviceOrientationNotifications ]; [[ NSNotificationCenter   defaultCenter ]  addObserver :  self                                               selector :  @selector (orientationWillChange:)                                                   name :  UIApplicationWillChangeStatusBarOrientationNotification                ...

iOS Dev: How to install GCC Compiler on Mac OS-X?

How to install GCC Compiler on Mac OS-X? Problem Description: Often times, you need c or gcc compiler to compile open source projects in Mac OS X. The problem is Mac OS X doesn’t install the gcc compiler by default. If you try to install or compile some projects that required c/gcc compiler, following errors message will be logged : configure: error: C compiler cannot create executables  configure: error: no acceptable C compiler found in $PATH In terminal, type “ gcc “, you will get message “command not found”. $ gcc -bash: gcc : command not found Solution: First Way --> To install gcc compiler on Mac OS X, you need to download and install “ Command Line Tools for Xcode ”, which is available in Apple’s developer page. See following steps : Register Apple Developer Account : Go to Apple Developer Login  page and register your account or login with our existing account details. Command Line Tools for XCODE : In Apple developer page, “ De...

iOS Dev: How to create .ipa file using XCODE

How to create .ipa file using Xcode ? Here your answer:     First question is that which version of XCODE you are using, Procedure for Xcode 4.3 and above : As of Xcode 4.3, there is no option of Share in organizer.  1.First of all,choose your device as  IOS Device  in  Scheme  near Breakpoint tab in Xcode. 2.In Xcode menu, Product->Clean  and  Product-->build  your application. 3.If the provisioning certificate is not valid,it will lead to build failed with an error.If so you have to change it to a valid certificate through your  project->build  settings.Else if build succeeded just leave this step. 4.Then select Product->archive ,it will create an archive file in Organiser->archives and open it up for you after archive finished. 5. Choose Distribute and then select the option for save as enterprise or adhoc application. 6. Saved it your .ipa file in your desktop. if you are u...

iOS Dev: Access Address Book in iOS6 (Permission)

In iOS 6 :  Access the Address Book details by this code: -(BOOL)isABAddressBookCreateWithOptionsAvailable {    return &ABAddressBookCreateWithOptions != NULL; } your method code :{ CFErrorRef error = NULL; ABAddressBookRef addressBook ; //ABAddressBookRef addressBook = ABAddressBookCreate(); if ([self isABAddressBookCreateWithOptionsAvailable]) {    addressBook = ABAddressBookCreateWithOptions(NULL,&error);   ABAddressBookRequestAccessWithCompletion(addressBook, ^(bool granted, CFErrorRef error) { // callback can occur in background, address book must be accessed on thread it was created on    dispatch_async(dispatch_get_main_queue(), ^{         if (error) {                       NSLog(@"error == %@",error);        } else if (!granted) {  ...

iOS Dev: Apple iOS 6 Orientataion Problem

Here the solution: From Apple's iOS 6 SDK Release Notes: Autorotation is changing in iOS 6. In iOS 6, the shouldAutorotateToInterfaceOrientation: method of UIViewController is deprecated . In its place, you should use the supportedInterfaceOrientationsForWindow: and shouldAutorotate methods. More responsibility is moving to the app and the app delegate. Now, iOS containers (such as UINavigationController) do not consult their children to determine whether they should autorotate. By default, an app and a view controller’s supported interface orientations are set to UIInterfaceOrientationMaskAll for the iPad idiom and UIInterfaceOrientationMaskAllButUpsideDown for the iPhone idiom . A view controller’s supported interface orientations can change over time—even an app’s supported interface orientations can change over time. The system asks the top-most full-screen view controller (typically the root view controller) for its supported interface orientations whene...

iOS Dev: Apple’s iOS 6 beta 3 changes

Apple has seeded iOS 6 beta 3 to developers, and here is the change log directly from Apple’s developer portal: Notes and Known Issues The following issues relate to using iOS SDK 6.0 to develop code. Address Book When an app is in a fresh privacy state and tries to present a ABNewPersonViewController , the user cannot dismiss that view controller properly even if they allow access to contacts. The user must force quit the app and relaunch. Requesting access to contacts: Users are able to grant or deny access to contact data on a per-app basis. To request access to contact data, call the ABAddressBookRequestAccessWithCompletion function after calling the ABAddressBookCreateWithOptions function. The ABAddressBookRequestAccessWithCompletion function does not block the app while the user is being asked to grant or deny access. Until access has been granted, the ABAddressBookRef object will not contain any contacts and any attempt to modify contacts fails with a kABOpera...