Search This Blog

Monday, 24 September 2012

How to integrate camera in xcode

Hello friends,
               Long time na???? actually i dint do anything new in these last days i surely made sketch book for kids on iPhone but not something great....apart from all that , here it is a simple yet useful code for you....


start camera on button click:

In a button click function :

UIImagePickerController * imagePicker = [[UIImagePickerController alloc] init];
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
imagePicker.delegate = self;
[self presentModalViewController:imagePicker animated:YES];
Remember i m not releasing the imagePicker as i use ARC in my projects ...
Now get the image captured in UIImage...override this function and remember 
to mention UIImagePickerControllerDelegate in your header file..
- (void)imagePickerController:(UIImagePickerController *)picker 
didFinishPickingMediaWithInfo:(NSDictionary *)info {
    UIImage * image = [info objectForKey:UIImagePickerControllerEditedImage];

    // You have the image. You can use this to present the image in the 
       next view like you require in `#3`.

    [self dismissModalViewControllerAnimated:YES];
Ask for any queries.....
This can lead you to new ideas....sorry for being selfish i can't tell
 you my idea, but presently i m using this simple thing to make something 
that never comes to itunes before.

Monday, 17 September 2012

How to know when a webview finish loading a page in xcode

Hello friends,
                its been a long time since i posted, so here it is a new one you will find awkward solutions for this as using some "theguide" 3rd party API and all but it is as simple as a button in xcode......i was working on it and i thought why dont we use webviewdelegate for this and i found it it is

Step 1:

Include UIWebViewDelegate in your header file:

Step 2:

And,then over ride this function in your .m file:

-(void)webViewDidFinishLoad:(UIWebView *)webView{
    //Do Something

this function will be called when a WebView finish loading a page , you can do anything in it.....Remeber to set the webview delegate to self.

Monday, 10 September 2012

How to use Push Notification in xcode

Hello friends,
                   sorry for being lazy, but i m going to provide the link with complete tutorial for how to use Push notification in your app......


ASk me if you face any problem implementing it....