archive-com.com » COM » B » BLOGMINES.COM

Total: 339

Choose link from "Titles, links and description words view":

Or switch to "Titles and links view".
  • What is Delegation in iOS ?
    tfMessage1 borderStyle UITextBorderStyleRoundedRect self view addSubview tfMessage1 void didReceiveMemoryWarning super didReceiveMemoryWarning Dispose of any resources that can be recreated end Now if you run the project using Xcode simulator the UITextView will be displayed You can type in the UITextField but when pressing Return on the keyboard will do nothing By using delegate pattern we are going to tell UIViewController to process the pressing of the return button on behalf of UITextField and hide the keyboard Step 1 Open the ViewController h file and implement the UITextViewDelegate as shown below import UIKit UIKit h interface ViewController UIViewController UITextFieldDelegate end Step 2 Navigate to viewDidLoad method in implementation file add self tfMessage1 delegate self as shown in the below code snippet void viewDidLoad super viewDidLoad Do any additional setup after loading the view typically from a nib UITextField tfMessage1 UITextField alloc initWithFrame CGRectMake 50 80 250 150 tfMessage1 borderStyle UITextBorderStyleRoundedRect self view addSubview tfMessage1 tfMessage1 delegate self This makes the UIViewController to act on behalf of UITextField Step 3 Now implement the following method that would process the Pressing of return key BOOL textFieldShouldReturn UITextField textField textField setUserInteractionEnabled YES textField resignFirstResponder return YES In Category Apple Develop ios Tagged as Apple

    Original URL path: http://blogmines.com/blog/what-is-delegation-in-ios/ (2016-04-25)
    Open archived version from archive


  • Different ways to connect IBAction to UIButton
    e g showAlert Event as Touch Up Inside then click Connect This should add a new IBAction entry in the header and implementation file Header file h Implementation File m Step 5 Now add the following UIAlertView code inside the showAlert method in implementation file UIAlertView alertView UIAlertView alloc initWithTitle Demo message IBAction Demo delegate self cancelButtonTitle nil otherButtonTitles nil nil alertView show Executing the project in the simulator should display the following alert on tapping the Button Method 2 Connections Inspector Step 1 Drag and drop a Round Rect Button on to the Interface builder Step 2 Navigate to implementation file and add the following IBAction code for displaying the Alert Step 3 Open nib file navigate to Show Connections Inspecto r option available on the left hand side Selecting the File Owner s option should display the details in the Connections Inspector This should display the IBAction method under the Received Actions section Step 4 select showAlert and drag it to the UIButton on the Interface builder Releasing the mouse click should display the following Events list Select Touch Up Inside from the list Once connected you should see the connection between the IBAction method and the control under Received Actions Method 3 Programmatically Step 1 Launch the implementation file for adding the Round Rect Button Programmatically Step 2 Add the IBAction showAlert method with the following alert message UIAlertView alertView UIAlertView alloc initWithTitle Demo message IBAction Demo delegate self cancelButtonTitle nil otherButtonTitles nil nil alertView show Step 3 Navigate to ViewDidLoad Method and add the following code to instantiate UI button and connect button to Touch Up Inside event with showAlert method void viewDidLoad super viewDidLoad Do any additional setup after loading the view typically from a nib UIButton btnDemo UIButton buttonWithType UIButtonTypeRoundedRect Create Round Rect Type

    Original URL path: http://blogmines.com/blog/different-ways-to-connect-ibaction-to-uibutton/ (2016-04-25)
    Open archived version from archive

  • How to add Android virtual device in eclipse
    Application Project in eclipse This occurs if there are no virtual device configured for testing the android apps Now let us see how to configure a Android Virtual Device using Android Virtual Device Manager Step 1 Launch Android Virtual Device Manager by clicking the AVD icon in eclipse Step 2 Click New button in Android Virtual Devices Step 3 In the Create new Android Virtual Device AVD screen choose the device simulator that you want and enter the other details as shown below The AVD also provides option to configure Front and Back Camera Memory Internal and SD card storage After providing the required details click OK button to confirm and save the changes Now you should see the newly added Android Virtual Device in the Device Manager Running the Android Application would launch your app on the Virtual Device In Category Android Develop Tagged as Android AVD Eclipse Simulator Virtual Device Spread the word How to insert current date and time in Word How to set Out of Office reply in Outlook Disable autocomplete suggestion feature in Excel How to increase number of worksheets Excel A trick to flip a column upside down in Excel Ravi Shankar A Software

    Original URL path: http://blogmines.com/blog/how-to-add-android-virtual-device-in-eclipse/ (2016-04-25)
    Open archived version from archive

  • Variables in Objective-C
    string data type and holds a name Variables must contain only letters and numbers also it is better to avoid using underscore character Be descriptive and avoid single letter or confusing words The variables are declared by first defining the datatype followed by description of variable Declaring primitive datatypes Examples int count 1 float width 23 34 Declaring Objects NSString description NSArray months The object variables are preceded with before

    Original URL path: http://blogmines.com/blog/variables-in-objective-c/ (2016-04-25)
    Open archived version from archive

  • Create an example iOS Project using Xcode
    cover the different templates in detail in future tutorials Step 3 Now in Choose options for your new project enter the name for your project organisation name and company identifier In the Devices drop down select iPhone and mark the check box with caption as Use Storyboards and Use Automatic Reference Counting and click Next button Some of the above terms like Storyboards Automatic Reference Counting will be covered in future tutorials Step 4 Specify the location for creating this project and click the Create button Now a new project should be created and you should see a screen as shown below Step 5 Select the MainStoryboard storyboard in the Navigator Pane to access the Interface Builder Step 6 Navigate to Utilities section and click Object tab Scroll down and pick label control from the list then drag and drop the label on to Interface Builder Step 7 Edit the label and enter Welcome text Step 8 Now select the iPhone simulator under Scheme section in Xcode toolbar Step 8 Select Run option on Xcode toolbar or use the keyboard combination of command R to run the sample project on Xcode simulator for iPhone command R will first compile and

    Original URL path: http://blogmines.com/blog/create-an-example-ios-project-using-xcode/ (2016-04-25)
    Open archived version from archive

  • Basic overview of Xcode
    Object library and Media library These tools help the developer with designing the user interface and writing coding using Xcode Editor This available at the Centre of Xcode window and used for writing your code Interface builder Interface builder or IB is available at the Centre of Xcode window when you navigate to your xib file or storyboard This allows users to build UI for their app Debug and Console Debug and Console panes are available at the bottom of Xcode window As the name suggests Debug provides option for debugging your app and console displays both system exceptions and app written messages Toolbar The Toolbar provides the option to Run Analyse Build and Test your App This is the place where you would specify whether you want to run the app in simulator iPhone or iPad or real device Another important feature of Toolbar is the option it provides to show or hide panes of Xcode The Editor option provides toggle option to show or hide Standard Editor Assistant Editor and Version Editor Similarly View option provide option to show or hide Navigator Debug Area and Utilities You can also launch Organizer from Xcode Toolbar Oragnizer This provides access

    Original URL path: http://blogmines.com/blog/basic-overview-of-xcode/ (2016-04-25)
    Open archived version from archive

  • NSLog datatype formatting option in Objective-C
    ull 12 NSString msg NSLog Message autoreleasepool NSLog print int d i NSLog print float f f use e for exponential NSLog print double f d use e for exponential NSLog print long int li li NSLog print short int i si NSLog print char c c NSLog print signed int i sint NSLog print unsigned int u uint NSLog print octal o o NSLog print hexadecimal X h NSLog print long long lld ll NSLog print long double Lf lf NSLog print unsigned long long llu ull NSLog print Object msg return 0 The console output of the above Objective C program is shown below 2013 03 04 07 25 10 187 NSLog Example 362 303 print int 5 2013 03 04 07 25 10 189 NSLog Example 362 303 print float 5 300000 2013 03 04 07 25 10 189 NSLog Example 362 303 print double 66 760000 2013 03 04 07 25 10 190 NSLog Example 362 303 print long int 22 2013 03 04 07 25 10 190 NSLog Example 362 303 print short int 12 2013 03 04 07 25 10 190 NSLog Example 362 303 print char W 2013 03 04 07 25 10 191 NSLog Example 362 303 print signed int 34 2013 03 04 07 25 10 191 NSLog Example 362 303 print unsigned int 4294967273 2013 03 04 07 25 10 192 NSLog Example 362 303 print octal 24 2013 03 04 07 25 10 192 NSLog Example 362 303 print hexadecimal AD 2013 03 04 07 25 10 193 NSLog Example 362 303 print long long 45 2013 03 04 07 25 10 193 NSLog Example 362 303 print long double 34 500000 2013 03 04 07 25 10 194 NSLog Example 362 303 print unsigned long long 12 2013

    Original URL path: http://blogmines.com/blog/nslog-datatype-formatting-option-in-objective-c/ (2016-04-25)
    Open archived version from archive

  • Different data types in Objective-C
    example4 n backlash character is a special character Data type int int data type is used for storing positive or negative whole numbers The range of values that can stored depends on the 32 bit or 64 bit operating system int count 10 int exoctal 036 int hex 0xADD2 in the above example 0 preceding the number represents octal value and hex number is preceded with 0x Date type float double float is used for storing positive or negative decimal numbers float exfloat 2 45 float exfloat2 0 345 float exfloat3 1 2e4 As shown in the last example float data type can be represented in scientific notation 1 2e4 which is equivalent 1 2x10th power of 4 double data type can store twice the range of float Data type BOOL BOOL is used for storing YES or NO i e 1 or 0 BOOL flag 1 Data type id id data type is used for storing object of any type id myfirstObject Qualifiers Qualifiers in Cbjective C are used for increasing range of the data type and the range is system dependant Qualifiers are placed just before the data type as shown below The different qualifiers are long long

    Original URL path: http://blogmines.com/blog/different-data-types-in-objective-c/ (2016-04-25)
    Open archived version from archive



  •