Create wrapper iOS application from HTML

by alex 12. March 2013 06:31
I wrote small service to create wrapper application froom HTML code http://html5wrapper.com/

Tags:

General

Get Device Model

by alex 9. January 2013 06:37

Tags:

Compare two NSDictionary

by alex 9. January 2013 06:22

Tags:

Methods to support orientation in iOS 6 SDK

by alex 31. October 2012 06:37

 

//For UIViewController's

- (BOOL)shouldAutorotate {

    return YES;

}

 

- (NSUInteger)supportedInterfaceOrientations {

    return UIInterfaceOrientationMaskAllButUpsideDown;

}

 

//For Delegate

- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {

    return UIInterfaceOrientationMaskAllButUpsideDown;

 

Tags:

General

myshareoftech.com

by alex 7. July 2012 20:53
My new link-blog about development, technology and science myshareoftech.com

Tags:

Get File Size

by alex 5. July 2012 07:22

-(NSNumber *)getFileSize:(NSString *)fileName{

    NSError *error = nil;

    NSDictionary *attributes = [[NSFileManager defaultManager]

            attributesOfItemAtPath:fileName error:&error];

 

    if (!error) {

        NSNumber *size = [attributes objectForKey:NSFileSize];

        return size;

    } else {

        return [NSNumber numberWithFloat:-1];

    }

 

}

Tags:

Remove duplicates from NSArray

by alex 10. April 2012 20:26

NSArray *arrWithDuplicates = [[NSArray alloc] initWithObjects: @"Bob", @"Bob",@"Olga", @"Olga", @"Robin", nil];

NSArray *cleanedArray = [[NSSet setWithArray:arrWithDuplicates] allObjects];

NSLog(@"%@", [cleanedArray description] );    


Tags:

Add days to NSDate

by alex 10. April 2012 03:12

 

for (int i = 1; i < 30; i++) {

    NSDate *newDate = [startDay.date dateByAddingTimeInterval:60*60*24*i];

    MDay *day = [[MDay alloc] init];

    day.date = newDate;

    [list addObject:day];

}

 

Tags:

Handle taps within a UIWebView

by alex 2. January 2012 08:57

//1. Add UIGestureRecognizerDelegate to your interface:

 

@interface DocumentViewControler : UIViewController <UIGestureRecognizerDelegate>

 

//2. Add to viewDidLoad

 

- (void)viewDidLoad {

    [super viewDidLoad];

    

    

    UITapGestureRecognizer* singleTap=[[UITapGestureRecognizer

                                        alloc]initWithTarget:self action:@selector(handleSingleTap:)];

    singleTap.numberOfTouchesRequired=1;

    singleTap.delegate=self;

    [self.webView addGestureRecognizer:singleTap];

    [singleTap release];

}

 

//3. Add:

 

-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer

shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer

                                                    *)otherGestureRecognizer {

    return YES;

}

 

//4.

 

-(void) handleSingleTap:(UITapGestureRecognizer *)recognizer  {

    NSLog(@"handleSingleTap");

    

    // Your code here

}

@end

Check if file exists

by alex 4. July 2011 18:46

BOOL fileExists = [[NSFileManager defaultManager] fileExistsAtPath:imagePath];

Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen