17 September 2012, 4:38 PM
To convert NSTimeInterval to NSString the following code works perfect

NSTimeInterval today = [[NSDate date] timeIntervalSince1970];
NSString *intervalString = [NSString stringWithFormat:@"%f", today];



12 September 2012, 3:54 PM
Find a string in an NSArray

NSArray *animals = [NSArray arrayWithObjects:@"Dog", @"Mouse", @"Cat", nil];
NSLog(@"Index: %i", [animals indexOfObject:@"Cat"]);

This would provide the following 
Index: 2



4 September 2012, 11:34 PM
Some simple code for converting string to int and int to string

String to Int
NSString *name = @"10";
int value = [name intValue];

Int to String
int value = 100;
NSString *name = [NSString stringWithFormat:@"%i", value];



7 February 2012, 12:57 PM

Working to show currency in a readable format


// 1 million coins is easier to read as 1,000,000
$value = "1000000";

// echo as 1,000,000
echo number_format($value, 0, '.', ',');

// echo as 1,000,000.00
echo number_format($value, 2, '.', ',');

// echo as 1:000:000
echo number_format($value, 0, '.', ':');

 




7 February 2012, 12:54 PM

Check to see if string is found. Looking for in string

NSString *input= @"does this string contain the word data";
NSString *find= @"data";

NSRange range;
for (NSString *string in stringList)

{
range = [input rangeOfString:find];
if (range.location != NSNotFound)
{
NSLog (@"feed ready for download");
}else{
NSLog (@"feed broken");
}

}

 




We have a large portfolio of work we have completed for clients. Our portfolio always carries our current new iPhone applications. Take a look

Follow us on Twitter, We aim to provide Live Information - @olliekett
 



© OKD Limited 2012 | Contact Us
OKD Limited is a private registered company in England and Wales.
 
Ollie Kett Designs - Tracking System