Math And Balloons can help your child to improve the basic math operations that include:
- addition,
- subtraction,
- multiplication,
- division
Enjoy.
![]() | |
![]() |
|
![]() |
![]() |
![]() |
![]() |
Objective C
|
Java
|
id
NSObject
NSInteger
NSString
BOOL
NSFloat
NSNumber
NSData/NSMutableData
NSArray
NSMutableArray
NSMutableDictionary
NSSet
NSDate
NSCalendar
Int
long
long long
bool
float
double
char
-
short
|
Class
Object
Integer
String
Boolean
Float
-
Byte
[]
List
Map
Set
Date
Calendar
Int
long
-
boolean
float
double
char
byte
short
|
Objective C
|
Java
|
int test = 0;
char name = ‘John Doe’;
NSInteger *number = [[NSInteger alloc] init];
NSString *stringType = [[NSString alloc] init];
NSMutableArray *dataArray = [[NSMutableArray alloc] init];
NSNumber *genericNumber = [[NSNumber alloc] numberWithInt:1];
|
int test = 0;
char name = ‘j’;
Integer number = new Integer();
String stringType = new String();
List dataList = new LinkedList();
-
|
isKindOfClass
|
instanceof
|
Objective C
|
Java
|
NSMutableArray *arr = [[NSMutableArray alloc] init];
[arr addObject:@”Test”];
[arr addObject:@”Test 2”];
NSString *testObj = [arr objectAtIndex:0];
id *testObj = (NSString *)[arr objectAtIndex:0];
|
1. List objList = new LinkedList();
2. List
objList.add(new String(“Test”));
objList.add(new String(“Test 2”));
1. String testObj = (String)objList.get(0);
2. String testObj = objList.get(0);
|
Objective C
|
Java
|
#define NUMBER_OF_MONTHS 12
#define YEAR _ATTRIBUTE @”year”
|
public static final int NUMBER_OF_MONTHS = 12;
public static final String YEAR _ATTRIBUTE = “year”;
|
Objective C
|
Java
|
@interface MyClass
{
NSString myVar;
}
+ (NSString *)myVar;
+ (void)setMyVar:(NSString *)newVa;
@end
@implementation MyClass
static NSString *myVar;
+ (NSString *)myVar { return myVar; }
+ (void)setMyVar:(NSString *)newVar { myVar = newVar; }
@end
[MyClass setMyVar:@”Test Value”];
NSLog(@”%@”,[MyClass myVar]);
|
public class MyClass {
public static String myVar;
public static String getMyVar(){ return this.myVar;}
public static void setMyVar(String myVar) {
this.myVar = myVar; }
}
MyClass.myVar = “Test Var”;
System.out.println(MyClass.getMyVar());
|
Objective C
|
Java
|
-(void)executeWithoutResult { }
-(void)executeByName: ( NSString *)name { }
-(void)executeByNameAndAge: (NSString *)name age: (int)age { }
-(NSString *)findUserById: (int)userId { }
+(int)findUserAges: (int)userId { }
|
public void executeWithoutResult() { }
public void executeByName(String name) { }
public void executeByNameAnd Age(String name, int age) { }
public String findUserById(int userId) { }
public int findUserAges (int userId) { }
|
Objective C
|
Java
|
CustomObject.h
@interface CustomObject:NSObject{
@public
NSString *stringValue_;
@private
NSInteger *integerValue_;
}
@property(nonatomic, assign) NSString *stringValue;
@property(nonatomic, assign) NSInteger *integerValue;
@end
CustomObject.m
#import “CustomObject.h”
@implementation CustomObject
@synthesize stringValue = stringValue_;
@synthesize integerValue = integerValue_;
-(id)init{
self = [super init];
if(self){
//call init methods
}
return self;
}
-(void)dealloc{
stringValue = nil;
[integerValue release];
[super dealloc];
}
@end
|
CustomObject.java
public class CustomObject{
public String stringValue;
private Integer integerValue;
public CustomObject(String stringValue, Integer integerValue){
this.stringValue = stringValue;
this.integerValue = integerValue;
}
public String getStringValue(){
return this.stringValue;
}
public void setStringValue(String stringValue){
this.stringValue = stringValue;
}
public Integer getIntegerValue(Integer integerValue){
return this.integerValue;
}
public void setIntegerValue(){
this.integerValue = integerValue;
}
}
|
CustomObject *obj = [[CustomObject alloc] init];
obj.stringValue = @”Test Value”;
[obj setStringValue:@”Test Value”];
NSLog(“%@”, obj.stringValue);
NSLog(“%@”, [obj getStringValue]);
[obj release];
|
CustomObject obj = new CustomObject();
obj.stringValue = “Test Value”;
obj.setStringValue(“Test Value”);
System.out.println(obj.stringValue);
System.out.println(obj.getStringValue());
|
@interface MyClass(Private){
-(void)someMethod;
}
@end
@implementation MyClass
-(void)someOtherMethod {}
@end
@implementation MyClass (Private)
-(void)someMethod {}
@end
|
public interface IMyClass{
private void someMethod();
}
public MyClass implements IMyClass{
private void someMethod() {}
}
|
The basic idea behind this toolkit is to separate UI implementation from the source code. This idea comes from the beautiful Java toolkit SWIXML which was implemented for allowing separation on UI from business logic in Swing based applications. This toolkit is also implemented in Android SDK core for same reason and is much more used then hard coded UI. The concept mutates to new programming paradigm which is also known as declarative programming where we specify UI and we regardless of how it will be created we just want initialized elements to manipulate with.
With using tool that allows us to make separation on UI from the business logic we will have cleaner code which is much better for reading and maintaining than putting everything into the class.
In iOS you can make UI with setting all properties into the code for every view that we use or by using Interface Builder which generate some messy XML structure that is understood only by the Interface Builder itself, but in this case because everything is auto generated we can’t change anything into this XML. Application that is implemented with using Interface Builder has also slower compile time than the application that has UI implementation into the view controllers. For that reason toolkit that separate UI from the code and keeps the UI definition as simple XML file instead of complicated XIB is welcome.
iOS Runtime UI Builder parse the XML UI definition with using the fastest XML DOM parser TBXML, creates object structure for every XML Tag with its attributes and keeps that objects in memory which is very fast because we don’t depend on complicated XIBs that are also slower to parse then simple XML file. After parsing and creating object structure, for every encapsulated view we automatically make initialization on each view with setting attributes which were defined in the XML Tags. The objects that encapsulate the views are stored into the fast data structure allowing us fast lookup for the concrete object and set initialized view to the reference into the code. With using this toolkit we make the code cleaner because every property is automatically set with changing complicated methods with only several written attributes into the XML Tags for every view that we create in main view. If we have complex views with many wrapped views inside them it’s not a problem, all that views will be automatically add into the parent view which gives us freedom to experiment with different UI concepts easily.
Check it on Google Code
https://code.google.com/p/ios-ui-runtime-builder/
