Coding Cluster - using asp.net, c#, mvc 4, iphone, php, ios, javascript, in asp.net mvc 3 & more
 

Solution:UITextView with Rounded / Colored Border - iPhone

Friday

UITextView with rounded border- iPhone:
                                              The following lines of code to add rounded corners and a border color to a UITextView. Fist, you import the QuartzCore like,

#import <QuartzCore/QuartzCore.h>

Then add the following code snippets into your viewdidload method for UITextview rounded/colored border.

Demo:

                  


Code :
yourTextView.layer.borderWidth = 1;
    [yourTextView.layer setBackgroundColor: [[UIColor whiteColor] CGColor]];
    [yourTextView.layer setBorderColor: [[UIColor brownColor] CGColor]];
    [yourTextView.layer setBorderWidth: 1.0];
    [yourTextView.layer setCornerRadius:8.0f];
    [yourTextView.layer setMasksToBounds:YES];
Please share this, if you think this is useful to others. Thanks!. 

Multiple UIAlertView in same UIViewController: iPhone

iphone - different alert views in one viewcontroller:
                      The following code is used to display two different alerts with different backgrounds in the same screen, put the following code snippet into your .m file;


Step 1: Define the key tokens.
#define AlertOne 1
#define AlertTwo 2
Step 2: Declare your alert views where ever needed like this. Don't forget to add tag.
UIAlertView *alert1 = [[UIAlertView alloc] initWithTitle:@"AlertView Title"  message:@"Message one" delegate:self  cancelButtonTitle:@"Cancel" 
otherButtonTitles:@"OK1", nil]; 
alert1.tag = AlertOne; // assigning the tag for this alert 
[alert1 show]; 
[alert1 release]; 

UIAlertView *alert2 = [[UIAlertView alloc] initWithTitle:@"AlertView Title"  message:@"Message two" delegate:self  cancelButtonTitle:@"Cancel" 
otherButtonTitles:@"OK2", nil]; 
alert2.tag = AlertTwo; // assigning the tag for this alert 
[alert2 show]; 
[alert2 release];
Step 3: Then implement the UIAlertViewDelegate methods like below: 
- (void)willPresentAlertView:(UIAlertView *)alertView { 
UIImage *alertImage = [[UIImage alloc] init]; 
if(alertView.tag == AlertOne) { 
alertImage = [UIImage imageNamed:@"orange.png"]; 
} 
else if(alertView.tag == AlertTwo) { 
alertImage = [UIImage imageNamed:@"blue.png"]; 
} 

alertImage = [alertImage stretchableImageWithLeftCapWidth:16 topCapHeight:14]; 
CGSize theSize = [alertView frame].size; 
UIGraphicsBeginImageContext(theSize); 
[alertImage drawInRect:CGRectMake(0, 0, theSize.width, theSize.height)]; 
alertImage = UIGraphicsGetImageFromCurrentImageContext(); 
UIGraphicsEndImageContext(); 
[[alertView layer] setContents:[alertImage CGImage]]; 
} 
Step 4: Atlast, implement different viewControllers for multiple buttons of UIAlertView like:
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex 
{ 
if(alertView.tag == AlertOne) { 
if(buttonIndex == 0) { 
// your code here
  } 
} 
else if(alertView.tag == AlertTwo) { 
if(buttonIndex == 1) { 
// your code here
} else NSLog(@"Hai codingcluster"); }
Please share this, if you think this is useful to others. Thanks!.

How to convert a database from mysql to sql server

Tuesday

Migrate MySQL to Microsoft SQL Server:
                                                           In one of my dotnet project I'm working with mysql database that is such a huge one, but I want a schema diagram, so decided to create  this same database on MS SQL Server for create schema diagram easily. That time this tool was so much help for me. The tool name is "Full Convert Enterprise".
                                                         Full Convert Enterprise is the easiest and most feature-rich database converter on the market. It will effortlessly migrate your database tables with all the data, create indexes, foreign keys - and more. This  is one of  a best tool for database migration.



This tool supporting the following converts.
  •  Microsoft Access
  • Microsoft Excel
  • MySQL
  • Microsoft SQL Server
  • SQL Server Compact/SQLCE
  • Oracle
  • PostgreSQL
  • Interbase
  • Firebird
  • Delimited text files (CSV)
  • XML
Download:
                   You can download this database converter from here

 
 
 

RECENT POSTS

Boost

 
Blogger Widgets