NSIndexPath *indexPath =[self.YourTable indexPathForCell:(UITableViewCell *)[[sender superview] superview]];
Thursday, March 22, 2012
Monday, March 19, 2012
Detecting a when a a UIScrollView reaches the bottom.
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
if (scrollView.contentOffset.y == scrollView.contentSize.height - scrollView.frame.size.height) {
// reached the bottom
}
}Tuesday, January 31, 2012
Getting subarray from Array
for (id element in CompleteArray) {
if([element isKindOfClass:[NSArray class]]){
NSMutableArray *Arr1 = [NSMutableArray arrayWithArray:element];
}else {
NSMutableArray *Arr2 = [NSMutableArray alloc]init];
[Arr2 addObject:element];
}
}
if([element isKindOfClass:[NSArray class]]){
NSMutableArray *Arr1 = [NSMutableArray arrayWithArray:element];
}else {
NSMutableArray *Arr2 = [NSMutableArray alloc]init];
[Arr2 addObject:element];
}
}
Thursday, December 1, 2011
MD5 Encryption in iPhone
#import <CommonCrypto/CommonDigest.h>//plz add coremobile and coretext framework....
NSString *str = urdata;// place your data here that you want to encrypt.....
const char *cStr = [str UTF8String];
unsigned char result[CC_MD5_DIGEST_LENGTH];
CC_MD5( cStr, strlen(cStr), result );
NSString *qrEncryptdata = [NSString stringWithFormat:
@"%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X",
result[0], result[1], result[2], result[3], result[4], result[5], result[6], result[7],
result[8], result[9], result[10], result[11], result[12], result[13], result[14], result[15]
];
NSLog(@"qrEncryptdata = |%@|",qrEncryptdata);
NSString *str = urdata;// place your data here that you want to encrypt.....
const char *cStr = [str UTF8String];
unsigned char result[CC_MD5_DIGEST_LENGTH];
CC_MD5( cStr, strlen(cStr), result );
NSString *qrEncryptdata = [NSString stringWithFormat:
@"%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X",
result[0], result[1], result[2], result[3], result[4], result[5], result[6], result[7],
result[8], result[9], result[10], result[11], result[12], result[13], result[14], result[15]
];
NSLog(@"qrEncryptdata = |%@|",qrEncryptdata);
Tuesday, October 25, 2011
custom camera overlay :)
-(void)viewDidLoad{
self.overlayView = [[UIView alloc] init];
self.overlayView.frame = CGRectMake(0, 0, 320, 480);
NSMutableArray *toolButtons = [NSMutableArray arrayWithCapacity:8];
UIBarButtonItem *btn;
UIImage *photogallaryBtnImg = [UIImage imageNamed:@"photo-gallery.png"];
UIBarButtonItem * photogallaryBtn = [[UIBarButtonItem alloc] initWithImage:photogallaryBtnImg style:UIBarButtonItemStylePlain target:self action:@selector(grabImage:)];
[toolButtons addObject:photogallaryBtn];
[photogallaryBtn release];
btn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
[toolButtons addObject:btn];
[btn release];
UIImage *cameraBtnImg = [UIImage imageNamed:@"camera.png"];
UIBarButtonItem *cameraBtn = [[UIBarButtonItem alloc] initWithImage:cameraBtnImg style:UIBarButtonItemStylePlain target:self action:@selector(camera:)];
[toolButtons addObject:cameraBtn];
[cameraBtn release];
btn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
[toolButtons addObject:btn];
[btn release];
UIImage *flashImg = [UIImage imageNamed:@"flashlight.png"];
UIBarButtonItem *flashBtn = [[UIBarButtonItem alloc] initWithImage:flashImg style:UIBarButtonItemStylePlain target:self action:@selector(flashLightBtnPressed:)];
[toolButtons addObject:flashBtn];
[flashBtn release];
btn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
[toolButtons addObject:btn];
[btn release];
UIImage *crossImg = [UIImage imageNamed:@"camera-cancel.png"];
UIBarButtonItem *crossBtn = [[UIBarButtonItem alloc] initWithImage:crossImg style:UIBarButtonItemStylePlain target:self action:@selector(crossBtnClicked:)];
[toolButtons addObject:crossBtn];
[crossBtn release];
toolBar = [[UIToolbar alloc] initWithFrame:CGRectMake(0,415, 320, 44)];
toolBar.items = toolButtons;
NSLog(@"toolBar.items ...%d",[toolBar.items count]);
toolBar.barStyle = UIBarStyleDefault;
[self.overlayView addSubview:toolBar];
[toolBar release];
UIImageView *footimage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"foot.png"]];
footimage.frame = CGRectMake(80,0,138 ,333);
[footimage setContentMode:UIViewContentModeScaleToFill];
footimage.backgroundColor = [UIColor clearColor];
[self.overlayView addSubview:footimage];
[self performSelector:@selector(takePhoto:) withObject:nil afterDelay:0.1];
}
- (void)takePhoto:(id)sender {
[[UIApplication sharedApplication] setStatusBarHidden:NO];
self.imgPicker = [[UIImagePickerController alloc] init];
self.imgPicker.sourceType = UIImagePickerControllerSourceTypeCamera;
self.imgPicker.showsCameraControls = NO;
self.imgPicker.cameraOverlayView = self.overlayView;
[self presentModalViewController:self.imgPicker animated:YES];
NSLog(@"camera opnnn....");
}
- (void)camera:(id)sender{
[self.imgPicker takePicture];
self.imgPicker.delegate = self;
NSLog(@"cameraf opnnn....");
}
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)img editingInfo:(NSDictionary *)editInfo {
image.image = img;
NSLog(@"delegate camera");
[[picker parentViewController] dismissModalViewControllerAnimated:YES];
}
- (IBAction)crossBtnClicked:(id)sender{
NSLog(@"crossbtn");
[[self.imgPicker parentViewController] dismissModalViewControllerAnimated:YES];
[self.tabBarController setSelectedIndex:3];
}
- (IBAction)grabImage:(id)sender {
NSLog(@"grabImage");
[[UIApplication sharedApplication] setStatusBarHidden:NO];
self.imgPicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
self.imgPicker.delegate = self;
[self presentModalViewController:self.imgPicker animated:YES];
}
- (IBAction)flashLightBtnPressed:(id)sender
{
if (self.imgPicker.cameraFlashMode == UIImagePickerControllerCameraFlashModeOff) {
[self.imgPicker setCameraFlashMode:UIImagePickerControllerCameraFlashModeOn];
}else {
[self.imgPicker setCameraFlashMode:UIImagePickerControllerCameraFlashModeOff];
}
}
self.overlayView = [[UIView alloc] init];
self.overlayView.frame = CGRectMake(0, 0, 320, 480);
NSMutableArray *toolButtons = [NSMutableArray arrayWithCapacity:8];
UIBarButtonItem *btn;
UIImage *photogallaryBtnImg = [UIImage imageNamed:@"photo-gallery.png"];
UIBarButtonItem * photogallaryBtn = [[UIBarButtonItem alloc] initWithImage:photogallaryBtnImg style:UIBarButtonItemStylePlain target:self action:@selector(grabImage:)];
[toolButtons addObject:photogallaryBtn];
[photogallaryBtn release];
btn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
[toolButtons addObject:btn];
[btn release];
UIImage *cameraBtnImg = [UIImage imageNamed:@"camera.png"];
UIBarButtonItem *cameraBtn = [[UIBarButtonItem alloc] initWithImage:cameraBtnImg style:UIBarButtonItemStylePlain target:self action:@selector(camera:)];
[toolButtons addObject:cameraBtn];
[cameraBtn release];
btn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
[toolButtons addObject:btn];
[btn release];
UIImage *flashImg = [UIImage imageNamed:@"flashlight.png"];
UIBarButtonItem *flashBtn = [[UIBarButtonItem alloc] initWithImage:flashImg style:UIBarButtonItemStylePlain target:self action:@selector(flashLightBtnPressed:)];
[toolButtons addObject:flashBtn];
[flashBtn release];
btn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
[toolButtons addObject:btn];
[btn release];
UIImage *crossImg = [UIImage imageNamed:@"camera-cancel.png"];
UIBarButtonItem *crossBtn = [[UIBarButtonItem alloc] initWithImage:crossImg style:UIBarButtonItemStylePlain target:self action:@selector(crossBtnClicked:)];
[toolButtons addObject:crossBtn];
[crossBtn release];
toolBar = [[UIToolbar alloc] initWithFrame:CGRectMake(0,415, 320, 44)];
toolBar.items = toolButtons;
NSLog(@"toolBar.items ...%d",[toolBar.items count]);
toolBar.barStyle = UIBarStyleDefault;
[self.overlayView addSubview:toolBar];
[toolBar release];
UIImageView *footimage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"foot.png"]];
footimage.frame = CGRectMake(80,0,138 ,333);
[footimage setContentMode:UIViewContentModeScaleToFill];
footimage.backgroundColor = [UIColor clearColor];
[self.overlayView addSubview:footimage];
[self performSelector:@selector(takePhoto:) withObject:nil afterDelay:0.1];
}
- (void)takePhoto:(id)sender {
[[UIApplication sharedApplication] setStatusBarHidden:NO];
self.imgPicker = [[UIImagePickerController alloc] init];
self.imgPicker.sourceType = UIImagePickerControllerSourceTypeCamera;
self.imgPicker.showsCameraControls = NO;
self.imgPicker.cameraOverlayView = self.overlayView;
[self presentModalViewController:self.imgPicker animated:YES];
NSLog(@"camera opnnn....");
}
- (void)camera:(id)sender{
[self.imgPicker takePicture];
self.imgPicker.delegate = self;
NSLog(@"cameraf opnnn....");
}
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)img editingInfo:(NSDictionary *)editInfo {
image.image = img;
NSLog(@"delegate camera");
[[picker parentViewController] dismissModalViewControllerAnimated:YES];
}
- (IBAction)crossBtnClicked:(id)sender{
NSLog(@"crossbtn");
[[self.imgPicker parentViewController] dismissModalViewControllerAnimated:YES];
[self.tabBarController setSelectedIndex:3];
}
- (IBAction)grabImage:(id)sender {
NSLog(@"grabImage");
[[UIApplication sharedApplication] setStatusBarHidden:NO];
self.imgPicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
self.imgPicker.delegate = self;
[self presentModalViewController:self.imgPicker animated:YES];
}
- (IBAction)flashLightBtnPressed:(id)sender
{
if (self.imgPicker.cameraFlashMode == UIImagePickerControllerCameraFlashModeOff) {
[self.imgPicker setCameraFlashMode:UIImagePickerControllerCameraFlashModeOn];
}else {
[self.imgPicker setCameraFlashMode:UIImagePickerControllerCameraFlashModeOff];
}
}
Wednesday, October 19, 2011
How to create free account on itune....:)
Select a free app to download. A simple way to do this is to scroll down to the Top Free Apps box on the right side, hover your mouse over the first item, and click on the Free button that appears when you hover over it.

A popup will open asking you to sign in with your Apple ID. Click “Create New Account”.

Click Continue to create your account.

Check the box to accept the Store Terms and Conditions, and click Continue.

Enter your email address, password, security question, and date of birth, and uncheck the boxes to get email if you don’t want it…then click Continue.
Now, you will be asked to provide a payment method. Notice now that the last option says None! Click that bullet option…

Then enter your billing address. Simply enter your normal billing address, even though you are not entering a payment method. Click Continue and your account will be created!

If you get the Address Verification screen just verify your county and click Done.
An email will be sent to you to verify your account…
Click on the link in your email to verify your account, iTunes will launch and you’re prompted to enter in the Apple ID and Password you just created.
Your account is successfully created!
A popup will open asking you to sign in with your Apple ID. Click “Create New Account”.
Click Continue to create your account.
Check the box to accept the Store Terms and Conditions, and click Continue.
Enter your email address, password, security question, and date of birth, and uncheck the boxes to get email if you don’t want it…then click Continue.
Now, you will be asked to provide a payment method. Notice now that the last option says None! Click that bullet option…
Then enter your billing address. Simply enter your normal billing address, even though you are not entering a payment method. Click Continue and your account will be created!
If you get the Address Verification screen just verify your county and click Done.
An email will be sent to you to verify your account…
Click on the link in your email to verify your account, iTunes will launch and you’re prompted to enter in the Apple ID and Password you just created.
Your account is successfully created!
Tips & Tricks: Installing an iPhone or iPad App with Provisioning Profile
To install an iPhone or iPad application on a limited number of devices, use the method of distribution called “Ad hoc”.
uses iTunes. First connect your iPhone to the computer. When your iPhone it detected by iTunes, click and go to the “Summary” tab.

Then click on “Serial Number”. The field will change to “Login (UDID)”.

You just have to copy the UDID “ + c” in mac or “Ctrl + c” under Windows. Now you can copy it to your e-mail.
Once you have communicated your UDID, just continue with the last two Ad Hoc distribution steps.
STEP 2 – The application is compiled and signed with the distribution profile. It is in this profile that devices authorized to the run application are listed.
STEP 3 - Deploying the application on your device.
Let’s now focus on this last step, where two files are needed:
These two files (once unzipped) should be dragged on the iTunes icon:

Note: iTunes may ask you to replace the existing application or profile.
Once copied, you simply synchronize your device. Please note that a newly installed application will be displayed on the first application screen in on the first available spot, and not on the last application page.
uses iTunes. First connect your iPhone to the computer. When your iPhone it detected by iTunes, click and go to the “Summary” tab.
Then click on “Serial Number”. The field will change to “Login (UDID)”.
You just have to copy the UDID “ + c” in mac or “Ctrl + c” under Windows. Now you can copy it to your e-mail.
Once you have communicated your UDID, just continue with the last two Ad Hoc distribution steps.
STEP 2 – The application is compiled and signed with the distribution profile. It is in this profile that devices authorized to the run application are listed.
STEP 3 - Deploying the application on your device.
Let’s now focus on this last step, where two files are needed:
- A compressed file containing the provisioning profile (valid for a limited time).
- A compressed file containing the application.
These two files (once unzipped) should be dragged on the iTunes icon:
Note: iTunes may ask you to replace the existing application or profile.
Once copied, you simply synchronize your device. Please note that a newly installed application will be displayed on the first application screen in on the first available spot, and not on the last application page.
Subscribe to:
Posts (Atom)