Friday, January 20, 2012

reduce file size in xcode

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
    {
        self = [super initWithNibName:@"ViewController_iPad" bundle:nibBundleOrNil];
        if (self) {
            // Custom initialization
        }}
    else
    {
        self = [super initWithNibName:@"ViewController_iPhone" bundle:nibBundleOrNil];
       
    }
    return self;
}

create navigation controller using view based application

UIViewController *rootController = [[ViewController alloc]initWithNibName:@"ViewController_iPhone" bundle:nil];
UIViewController *rootController1 = [[ViewController alloc]initWithNibName:@"ViewController_iPad" bundle:nil];

UINavigationController *navigationController = [[UINavigationController alloc]
                        initWithRootViewController:rootController];
// navigationController = [[UINavigationController alloc]initWithRootViewController:rootController1];



self.window = [[UIWindow alloc]
               initWithFrame:[[UIScreen mainScreen] bounds]];
[self.window addSubview:navigationController.view];
[self.window makeKeyAndVisible];
return YES;

upload images to website in xcode using .asmx file extension (web service)

This summary is not available. Please click here to view the post.

Wednesday, January 11, 2012

Adding images directly to iPhone Simulator

open simulator  click and drag image to safari web browser after that Hold your click on the image,When the pop-up appears, choose Save Image,now the photo appear in photos in simulator

Tuesday, January 10, 2012

reduce the font size for self.title in xcode

self.title = @"xxxxxxxxxxxxx";
    CGRect frame = CGRectMake(0, 0, [self.title sizeWithFont:[UIFont boldSystemFontOfSize:20.0]].width, 44);
    UILabel *label = [[UILabel alloc] initWithFrame:frame];
    label.backgroundColor = [UIColor clearColor];
    label.font = [UIFont boldSystemFontOfSize:17.0];
    label.textAlignment = UITextAlignmentCenter;
    self.navigationItem.titleView = label;
    label.text = self.title;
    [label release];