Tips for Bounds and Frames in IOS

Tips for Bounds and Frames in IOS

The bounds of an UIView is the rectangle, expressed as a location (x,y) and size (width,height) relative to its own coordinate system (0,0). The frame of an UIView is the rectangle, expressed as a location (x,y) and size (width,height) relative…

Tips to create dropdown list in IOS

Tips to create dropdown list in IOS

The Native iOS controls do not specifically have a native control for a dropdown. What we want is a control that behaves like a dropdown that uses a UIPickerControl . Native iOS dropdown To create the dropdown arrow we create…

Tips for beginner programming mistakes

Fear and lack of self-confidence The number one mistake you can make as a beginner programmer is to think you’re not good enough, not smart enough: that you have the wrong type of brain, and you’ll just never get it.…

Tips for How to write Better Code

Use a Coding Standard It’s easy to write a line of code, unorganized code, but it’s hard to maintain such code. Good code typically follows some standard for naming conventions, formatting, etc. Such standards are nice because they make things…

Simple Objective-C Tutorial For Developing Apps in IOS

Objective-C is an object-oriented programming language, and is a layer over the C programming language. This means that if you know how to write C, there are only a few syntax changes to learn. In this section, we will look…

There are three distinct approaches to iOS development:

Web Application Development The original iPhone OS 1.0 required all non-Apple applications to be web-based and executed within the Mobile Safari web browser. Because Mobile Safari does not support plugins like Adobe Flash or Microsoft Silverlight, this meant that all…

How to prevent SQL Injection in iOS apps?

Application Security is a primary concern of every mobile application developer whether it is iPhone app, iPad app, Universal app in iOS, Android app, Blackberry app, Windows Phone app or tablet app. And most of the vulnerability attacks are due…

How To Manage NSMutableDictionary And NSMutableArray

//create the dictionary NSMutableDictionary *dictionary = [[NSMutableDictionary alloc] init]; //add keyed data [dictionary setObject:@"Object One" forKey:@"1"]; [dictionary setObject:@"Object Two" forKey:@"2"]; [dictionary setObject:@"Object Three" forKey:@"3"]; //write out Object Three to the log NSLog(@"%@", [dictionary objectForKey:@"3"]); //release the dictionary [dictionary release]; //create…

How to catch a Nan?

Nan represents Not a number When it happens to get a Nan as a result of an expression you have to find a way to catch it before. Let’s think an if statement and inside this the appropriate check. A…

How To Remove and Replace String within a String.

// Here We Deleting Something NSString *content = @"i am a good boy"; NSCharacterSet *deleteString = [NSCharacterSet characterSetWithCharactersInString:@"good"]; content = [[content componentsSeparatedByCharactersInSet: deleteString] componentsJoinedByString: @""]; NSLog(@"String===>>>%@", content); // Here We Replace Something NSString *replaceString = @"i am a good boy";…

How to validate or Allow Only Numeric value TextField in IOS or objective-c

- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string { BOOL allowChange = YES; if ([textField isEqual:zipText]) { allowChange = NO; int textLength = [textField.text length]; int value; if (([string isEqualToString:@""])) { allowChange=YES; } else { value = (int) [string characterAtIndex:0]; } if…

How to use datatype in IOS or Objective-c

%@ Object %d, %i signed int %u unsigned int %f float/double %x, %X hexadecimal int %o octal int %zu size_t %p pointer %e float/double (in scientific notation) %g float/double (as %f or %e, depending on value) %s C string (bytes)…