Showing posts with label Apple. Show all posts
Showing posts with label Apple. Show all posts

iOS - First iPhone Application

Creating the First App

Now we are going to create a simple single view application (a blank app) that will run on the iOS simulator.
The steps are as follows.
Step 1 − Open Xcode and select Create a new Xcode project.


Step 2 − Select Single View Application.


Step 3 − Enter the product name, i.e., the name of the application, organization name, and then the company identifier.


Step 4 − Ensure that Use Automatic Reference Counting is selected in order to automatically release the resources allocated once it goes out of scope. Click Next.
Step 5 − Select the directory for the project and select create.


Step 6 − You will see a screen as follows −


In the screen above, you will be able to select the supported orientations, build and release settings. There is a field deployment target, the device version from which we want to support, lets select 4.3, which is the minimum deployment target allowed now. For now, these are not required and let's focus on running the application.
Step 7 − Now, select iPhone simulator in the drop down near Run button and select run.


Step 8 − That's it; you have successfully run your first application. You will get an output as follows −

Now let's change the background color, just to have a start with the interface builder. Select ViewController.xib. Select background option in the right side, change the color and run.


In the above project, by default, the deployment target would have been set to iOS 6.0 and auto-layout will be enabled. To ensure that our application runs on devices that are on iOS 4.3 onwards, we have already modified the deployment target at the start of creation of this application, but we didn't disable auto-layout.
To disable auto-layout, we need to deselect the auto-layout checkbox in the file inspector of each nib, i.e., the xib files. The various sections of Xcode project IDE are given in the following figure (Courtesy: Apple Xcode 4 User documentation).

File inspector is found in the inspector selector bar as shown above and auto layout can be unchecked there. Auto layout can be used when you want to target only iOS 6 devices. Also, you'll be able to use many new features like passbook if you raise the deployment target to iOS 6. For now, let's stick to iOS 4.3 as the deployment target.

Code of the First iOS Application

You will find five different files that would have been generated for your application. They are listed as follows −
  • AppDelegate.h
  • AppDelegate.m
  • ViewController.h
  • ViewController.m
  • ViewController.xib

AppDelegate.h

// Header File that provides all UI related items. 
#import

// Forward declaration (Used when class will be defined /imported in future)
@class ViewController;

// Interface for Appdelegate
@interface AppDelegate : UIResponder <UIApplicationDelegate>

// Property window
@property (strong, nonatomic) UIWindow *window;

// Property Viewcontroller

@property (strong, nonatomic) ViewController *viewController;
//this marks end of interface
@end
Important items in code −
  • AppDelegate inherits from UIResponder that handles iOS events.
  • Implements the delegate methods of UIApplicationDelegate, which provides key application events like finished launching, about to terminate and so on.
  • UIWindow object to manage and co-ordinate the various views on the iOS device screen. It's like the base view over which all other views are loaded. Generally there is only one window for an application.
  • UIViewController to handle the screen flow.

AppDelegate.m

// Imports the class Appdelegate's interface
import "AppDelegate.h"

// Imports the viewcontroller to be loaded
#import "ViewController.h"

// Class definition starts here
@implementation AppDelegate


// Method to intimate us that the application launched successfully
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions
:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

// Override point for customization after application launch.
self.viewController = [[ViewController alloc]
initWithNibName
:@"ViewController" bundle:nil];
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
return YES;
}

- (void)applicationWillResignActive:(UIApplication *)application
{
/* Use this method to release shared resources, save user data,
invalidate timers, and store enough application state information
to restore your application to its current state in case it is
terminated later. If your application supports background
execution, this method is called instead of
applicationWillTerminate: when the user quits.*/

}

- (void)applicationWillEnterForeground:(UIApplication *)application
{
/* Called as part of the transition from the background to the
inactive state. Here you can undo many of the changes made on
entering the background.*/

}

- (void)applicationDidBecomeActive:(UIApplication *)application
{
/* Restart any tasks that were paused (or not yet started) while
the application was inactive. If the application was previously in
the background, optionally refresh the user interface.*/

}

- (void)applicationWillTerminate:(UIApplication *)application
{
/* Called when the application is about to terminate. Save data if
appropriate. See also applicationDidEnterBackground:. */

}

- (void)applicationWillTerminate:(UIApplication *)application
{
/* Called when the application is about to terminate. Save data if appropriate.
See also applicationDidEnterBackground:. */

}

@end
Important items in code −
  • UIApplication delegates are defined here. All the methods defined above are UI application delegates and contains no user defined methods.
  • UIWindow object is allocated to hold the application allocated.
  • UIViewController is allocated as the window's initial view controller.
  • To make the window visible, makeKeyAndVisible method is called.

ViewController.h

#import  

// Interface for class ViewController
@interface ViewController : UIViewController

@end
Important items in code −
  • The ViewController class inherits the UIViewController, which provides the fundamental view management model for the iOS applications.

ViewController.m

#import "ViewController.h"

// Category, an extension of ViewController class
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}

@end
Important items in code −
  • Two methods implemented here are defined in the base class UIViewController.
  • Do initial setup in viewDidLoad which is called after the view loads.
  • didReceiveMemoryWarning method is called in case of memory warning.

How To Create a Bootable USB Installer for OS X El Capitan

This procedure explains how to create an installation key for Mac OS X El Capitan using a USB key. This method will work for OS X El Capitan, Yosemite, Mavericks, and Mountain Lion updates. 

How To Make an El Capitan Install Drive with a USB


El Capitan Information Pages on Apple.com

Before beginning, you may want to familiarize yourself with the upgrade process, and hardware requirements necessary for the El Capitan installation. 

Pre-Requisites for the El Capitan Update

There are several prerequisites necessary for a successful installment of El Capitan. A list of requirements for the compatible models can be found below.

Compatible Macs

MacBook (released early 2015), MacBook (aluminum series released late 2008 - early 2009 or later), 
MacBook Pro (released mid/late 2007 or newer models), 
MacBook Air (released late 2008 or newer models), 
Mac Mini (released early 2009 or newer models), 
Mac (released mid 2007 or newer models), 
Mac Pro (released early 2008 or newer), 
Xserve (released early 2009). 

Requirements

OS X 10.6.8 or later, 2GB of RAM (minimum), 
8GB of storage space, 
Some features require an Apple ID
Some features require a compatible Internet service provider; extra charges may apply. 

STEP 1: Download El Capitan

Launch the Apple App Store, and sign-in using your iCloud account. Click on OS X El Capitan >Download to begin the download process. The El Capitan download will utilize about 6GB of space. 

Once the installation package has been downloaded, it will launch automatically. Do not click onContinue

You may quit the installation by clicking on the Install OS X menu > Quit Install OS X. Leave the installation package (Install OS X El Capitan) in the Applications folder, and proceed to the next step. 

STEP 2: Prepare the USB Installation

You will need a blank 8GB USB key. Connect the USB key to your Mac and launch the Disk Utilitylocated in Applications > Utilities. Select your USB drive (not its existing partition, but the physical key itself). Click on Partition Layout and select 1 partition. Next, select the Optionbutton, making sure that GUID Partition Table is selected. Click OK

Select Mac OS Extended (Journaled) as the default format for the drive. Rename your USB key to something more significant (e.g. elcapitan) and make a note of it somewhere. You will need the exact name for a terminal command in STEP 3

Click on Apply > OK

STEP 3: Creating the Installation Key

Launch the Terminal application located in Applications > Utilities and type the below command: 

sudo /Applications/Install\ OS\ X\ El\ Capitan.app/Contents/Resources/createinstallmedia --volume /Volumes/e/name_of_USB --applicationpath /Applications/Install\ OS\ X\ El\ Capitan.app --nointeraction 

Replace name_of_USB with the name you have chosen for your USB key. 

Confirm with the Enter key, and type your administrator password when prompted. Let the process unfold until the Terminal window says Done

Your OS X El Capitan installation USB key is now ready. 

Updating from OS X Snow Leopard and Leopard

Additional steps are required when updating from Snow Leopard (Mac OS X 10.6.x)

Click on the Apple menu > Update software. Update to Mac OS X 10.6.8 before downloading El Capitan from the App Store. 

Unfortunately, El Capitan will install directly onto your Mac. You will need to download it once more to get the installation package (installer). If you have Leopard (Mac OS 10.5) and would like to upgrade to El Capitan, you must first purchase and install OS X Snow Leopard

Remarks

This method creates a USB key called Install OS X El Capitan. The key contains an installer (installation package) named as Install OS X El Capitan. To perform an installation from the USB key, connect it to your Mac and then boot the key while holding the Alt key down. Boot from the USB key and then follow the onscreen procedure to install the new operating system. 

N.B. If at any point the installation procedure seems to stall, just let it be. Despite appearances, the installation procedure is likely just working slowly.

Apple Watch - How To Mute Activity Alerts

The Activity app of the Apple Watch can help you to get healthier by achieving a couple daily fitness goals. Once enabled the app shall display reminders to stand up for at least 1 minute after each hour and burn more calories through exercising. WatchOS2 introduces a new feature which comes in handy on days where you are too busy to keep up with your fitness goals. You can now mute Activity Alerts for duration of 24 hours

Open the Apple Watch app installed on the paired iPhone. Go to My Watch >Activity App. Toggle the Mute Reminders for One Day switch On

That's it; you won't receive reminders for the rest of the day and this applies to the Progress updatesStand RemindersAchievements and Goal Completions alerts.

How to Return Apps Purchased from the Mac App Store

If you have accidentally purchased an app from the Mac App Store, or if the app isn’t functioning as expected, or if you are experiencing technical issues with an app, you can request a refund from Apple. Not every app downloaded from the Mac App store may be eligible for refunds but for others, if you have a good case, you can return the app and your credit card charges will be reversed.
For some reason, the procedure for returning apps to the Mac App Store isn’t straight forward so here’s an illustrated guide that will walk you through the entire process step-by-step. It will only apply to app purchases made in the last 90 days.

How to Request Refunds for Mac Apps

Step 1: Click this special link – phobos.apple.com/purchasehistory – and it open your app purchase history directly inside iTunes. Alternately, open iTunes on your Mac and choose Store -> View Account. Next click See All under thePurchase History section to see all your recent app purchases.
This is confusing but you have to open iTunes to see a list of your past purchases. The App Store will also show your purchase history but you won’t be able to return apps through the App Store.
Step 2: Click the Report a Problem link available against all your recent app purchases. If the Mac app is not listed in your recent purchased list, click the little grey arrow to expand the order that contains your app and click the Report a Problem link against that app that you are looking to refund.


Step 3: When you do that, it will redirect you the reportaproblem.apple.com website and here you have to specify the reason for requesting a refund for the app. You are more likely to choose “I didn’t authorize the purchase” or “Item functions but doesn’t work as expected” and describe the exact issue you are experiencing with the app.

How to Get Refunds from the iTunes App Store

How to Get Refunds from the iTunes App Store

The iTunes Apps Store policy states that all sales are final but if you have a genuine and valid reason, Apple will issue a refund. If you are wondering why would anyone want refunds for apps, books or games purchased from the iTunes store, consider the following situations:

  • You ordered an HD movie from the iTunes store but after making the purchase, you realize that it would take several hours to download that massive file to your computer. You can stop the download but your credit card will still be charged.
  • You have an iPhone but you accidentally bought an iPad version of some app which is obviously of no use to you. You can ask Apple for a refund.
  • You wanted to buy a game but there were at least a dozen similar titles on the iTunes store (remember Flappy Birds?). The app you finally bought is not the one you were originally looking for and you therefore want to return it to Apple.
  • You have two or more iTunes accounts and you purchased an iPhone App using the wrong iTunes account. You can’t transfer apps across accounts so a refund followed by re-purchase makes more sense.
  • The 1-Click ordering system, that Apple licensed from Amazon, makes it easy for anyone to buy apps, songs, movies and games from the iTunes store with a single click but this can sometimes lead to accidental purchases especially when kids have access to your devices. They may make in-app purchases without your knowledge.
These are just some of the legitimate reasons why   people may want to return their iTunes store purchases and request refunds from Apple.

Return your iTunes Store Purchases to Apple

The iTunes App store sales policy clearly says that you cannot cancel a purchase or receive a refund for a purchase but they are known to make exceptions if you have a valid reason.
For instance, I recently purchased the $2.99 Reeder app from the iTunes store but only after installing it on my iPad did I realize that it was an iPhone-only app and not designed for the iPad. I requested a refund from Apple and how they reversed the charges in less than 4 hours.
Here’s how you can return apps to the iTunes Store and request a refund:
Step 1: Locate the invoice receipt for your iTunes Store purchase and click the “Report Problem” link next to the name of the app (or game or movie or song) that you would like to return.
If you have deleted the email invoice that Apple sent you after you completed the purchase, launch the iTunes program using this special link and you’ll see a list of all items that you’ve bought from the iTunes store. Open an order by clicking the “Report a problem” next to the app name.
Alternatively, if you do not have iTunes on your computer, go to reportaproblem.apple.com to submit a refund request to Apple from your web browser.
Step 2: Sign-in with your Apple ID and then choose an option from the drop-down menu that best describes your problem. If you have purchased an app accidentally, choose “I didn’t mean to purchase this item.” If the kids have made an in-app purchase, choose “I didn’t authorize this purchase.” If you aren’t happy with the app, choose “Item opens but doesn’t function as expected.”
You can expect a response from Apple in the next 24-48 hours. If Apple support is satisfied with your reasoning, they’ll reverse the credit card charges. Please remember that you are not entitled to a refund under the iTunes Store Sales policy so if they deny your request for a refund, move on!
In some cases, Apple may issue refunds for app purchases immediately without involving the support team. When you submit an issue with an app using the above form, it will offer you a “Refund” option. Click that and you’ll get an email notification from Apple saying you’ve been issued a refund.

Kategori

Kategori