IOS Tips & Tricks Links

http://xcodeblog.com/2012/10/14/loading-images-asynchronously-on-iphone-using-nsinvocationoperation.xcb

http://xcodeblog.com/2012/11/08/sizes-of-iphone-ui-elements.xcb

http://samwize.com/2012/09/26/xcode-4-dot-5-tips-and-tricks/

http://xcodeblog.com/2012/10/31/back-to-basic-objective-c-loop-if-else-statement.xcb

http://xcodeblog.com/2012/10/14/introduction-to-in-app-purchases-in-ios-6.xcb

http://www.coderssource.com/post/2013/01/30/Objective-C-Tips-and-Tricks.aspx

Replace last comma in string (Objective-C)

NSString *str =@"a,b,c,d,";

NSRange lastComma =[str rangeOfString:@"," options:NSBackwardsSearch];

if(lastComma.location !=NSNotFound){ str =[str stringByReplacingCharactersInRange:lastComma withString:@"."];

}

XCode define string contains function

 

#define contains(str1, str2)([str1 rangeOfString: str2 ].location !=NSNotFound)

//using
NSString a =@"PUC MINAS - BRAZIL";
NSString b =@"BRAZIL";

if( contains(a,b))
{
//TO DO HERE}