Showing posts with label iphonesnippet. Show all posts
Showing posts with label iphonesnippet. Show all posts

Tuesday, 6 November 2012

remove the background color from search bar in iPhone

for (UIView *subview in [searchBar subviews]) {
    if ([subview isKindOfClass:NSClassFromString(@"UISearchBarBackground")])
    {
        [subview removeFromSuperview];
    }
}

for (UIView *subview in [searchBar subviews]) {
        NSLog(@"%@", [subview class]);
}

Customizing the search bar textfield in iPhone

http://caydenliew.com/2012/01/customize-uisearchbar-background-image/
for (UIView *subview in [searchBar subviews]) {
        if ([subview isKindOfClass:NSClassFromString(@"UISearchBarBackground")])
        {
            [d

        if ([subview isKindOfClass:NSClassFromString(@"UISearchBarTextField")]) {
            [(UITextField *)subview setBackground:[UIImage imageNamed:@"searchboxbg.png"]];
        }
    }

Changing the search bar textfield left search icon in iPhone

 UITextField *textfield=(UITextField*)[[searchBar subviews] objectAtIndex:0];
            UIImage *image = [UIImage imageNamed: @"searchbtn.png"];
            UIImageView *iView = [[UIImageView alloc] initWithImage:image];
            textfield.leftView=iView;

Checking device compatibilty comparision parameter in iphone

iPhone 1G
iPhone 3G
iPhone 3GS
iPhone 4
Verizon iPhone 4
iPhone 4S
iPad
iPad 2 (GSM)
iPad 2 (CDMA)
iPad-3G (4G)

Image color operation in iphone

https://github.com/tomsoft1/StackBluriOS
CIImage

Collection view in iOS 6 with Xcode 4.5 in iPhone

https://github.com/RomanN2/CollectionView

Starting to ending for the registering and issuing the certificate for the IOS program.

http://www.raywenderlich.com/8003/how-to-submit-your-app-to-apple-from-no-account-to-app-store-part-1

Not reloaded issue with the CellforTowAtIndexPath + tableview + iphone

http://blog.d-17.com/2009/10/combining-multiple-uitextfields-and-a-uitableview-in-a-nice-way-for-an-iphone-app-part-2/

https://github.com/breeno/EditingUITableView

Write down this statement to the cellforrowatindexPath method of tableview and it will work now.
NSString *CellIdentifier = [NSString stringWithFormat: @"Cell%i", indexPath.row];


Example......
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
   
    NSString *CellIdentifier = [NSString stringWithFormat: @"Cell%i", indexPath.row];
   
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] ;
        UITextField *textField = [[UITextField alloc]initWithFrame:CGRectMake(140.0, 12.0,170.0, 25.0)];
        textField.borderStyle = UITextBorderStyleNone;
        //yes strange, but otherwise the textfield won't show up :(
        cell.textLabel.backgroundColor = [UIColor blackColor];
        textField.tag=indexPath.row;
        //textField.text = [NSString stringWithFormat:@"value %i", indexPath.row];
        textField.placeholder= [NSString stringWithFormat:@"value %i", indexPath.row];
        [textField setDelegate:self];       
        //[textField addTarget:self                       action:@selector(textFieldDone:)
        //    forControlEvents:UIControlEventEditingDidEndOnExit];
        [cell.contentView addSubview:textField];
        [textField release];
        cell.textLabel.text = [NSString stringWithFormat:@"Item %i", indexPath.row];//[questionsArray objectAtIndex:indexPath.row];
        textField.returnKeyType=UIReturnKeyNext;
        if (indexPath.row==6) {
            textField.returnKeyType=UIReturnKeyDone;
        }
    }   
    cell.selectionStyle=UITableViewCellSelectionStyleNone;
    return cell;// autorelease];
}
 

Directly open up the map from the running app in iPhone

NSString* address = @"118 Your Address., City, State, ZIPCODE";
NSString* currentLocation = @"Current Location";
NSString* url = [NSString stringWithFormat: @"http://maps.google.com/maps?saddr=%@&daddr=%@",[currentLocation stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],[address stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
   UIApplication *app = [UIApplication sharedApplication];
[app openURL: [NSURL URLWithString: url]];

Saturday, 25 February 2012

smiley & emoji symbols code + iphone

smiley & emoji  symbols code

http://www.easyapns.com/category/just-for-fun

Friday, 24 February 2012

Simple animation+ iphone

Simple animation

http://www.edumobile.org/iphone/iphone-programming-tutorials/moveimage-in-iphone/

Checking white space and Trimming specific character in iphone

#define allTrim( anyobject ) [anyobject
 stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet] ]

NSString *stringname = @"   ";
if ( [allTrim( stringname ) length] == 0 ) NSLog(@"Is empty!");

drawing the rectangle lines on the any object + iphone

- (void)drawRect  {
    UIGraphicsBeginImageContext(self.view.frame.size);
   
    CGContextRef currentContext = UIGraphicsGetCurrentContext();
    CGContextSetLineWidth(currentContext, 3.0); //or whatever width you want
    CGContextSetRGBStrokeColor(currentContext, 0.0, 0.0, 0.0, 1.0);
   
    CGRect myRect = CGContextGetClipBoundingBox(currentContext);
    //printf("rect = %f,%f,%f,%f\n", myRect.origin.x, myRect.origin.y, myRect.size.width, myRect.size.height);
   
    CGContextStrokeRect(currentContext, myRect);
    UIImage *backgroundImage = (UIImage *)UIGraphicsGetImageFromCurrentImageContext();
    UIImageView *myImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
    [myImageView setImage:backgroundImage];
    [self.view addSubview:myImageView];
    [backgroundImage release];
   
    UIGraphicsEndImageContext();
}