Tag: objective c

Show image in ViewController when button is clicked in SecondViewController

How to show an UIIimage by clicking on an UIButton inside another UIViewController? I would like to add to the same UIButton the command to add an image to the SecondViewController. Excused my poor question. myProtocol.h #import <Foundation/Foundation.h> @protocol myProtocol <NSObject> -(UIImage *)transferImage; @end ViewController.h #import “SecondClass.h” @interface ViewController : UIViewController<myProtocol, UINavigationControllerDelegate>{ UIView *view; } […]

Sorting Array in iphone SDK

In my app, I have two arrays names listofevents & arr_Distance. Listofevents look like following: ( { Latitude = “34.1356031”; Longitude = “-118.0312634”; VenueName = “Fantasia Billiard”; }, { Latitude = “34.1356031”; Longitude = “-118.0312634”; VenueName = “Dave & Busters”; } ) arr_distace look like ( 54985.5455,54985.5455 ) I have calculate the distance as per […]

Estimated Time Between two Locations in iOS

What is proper way to get ETA (estimated time arrival) from AnyLocation to MyCurrentLocation? I want, when use tap on any annotation, then I have to set details on the Footer according to that annotation and user’s current location. Please see below image for better understanding. I saw this What is proper way to get […]

How do I increase the height of the title bar in a Cocoa application?

I have the following code for setting up my interface in a Cocoa application: #import <Foundation/Foundation.h> @interface uiview : NSObject { IBOutlet NSWindow *mainWindow; IBOutlet NSView *accessoryView;} // Methods – (void)composeInterface; -(IBAction)button : (id)sender; @end #import “uiview.h” @implementation uiview – (void)awakeFromNib { [self composeInterface]; [mainWindow setTitleWithRepresentedFilename:@”/Users/parag/Documents/UIview”]; } – (void)composeInterface { NSView *themeFrame = [[mainWindow contentView] […]

Open local PDF file in iBooks

I am trying to open a PDF file that I have stored locally within my app in iBooks. The app currently has a list of “literature” in a table view and when each cell is tapped the app segues to a webView that displays the PDF file (works great). I have made a BarButton at […]

Is it legal to create a recursive background handler in iphone?(processing when app enters the background)

If I register an app for background app in did enter background and make a background handler with approximately 10 mins to finish the task, after the time is over the handler will call finishing block and in this block again create the background handler you will get again 10 mins and so on, in […]

How to call a method once the completion block finish?

I want to call the signUp method first, once I got the userID, I need to call the another method normalSignupMethod. [ConnectionObj signUp:user]; [helper normalSignupMethod:dict]; signUp Method: [MYRequest signUp:user successBlock:^(QBResponse *response, QBUUser *user) { // Sign up was successful // Store user id [SingletonClass sharedMySingleton].userID = [NSString stringWithFormat:@”%@”,response.data[@”id”]]; } errorBlock:^(QBResponse *response) { // Handle error […]

Accessing an FTP connection for downloading files

i am new to iphone.. i want guidelines for accessing ftp server through objective c ,where ftp url, username,password should be given in program itself , i want to access a lot of image files from the ftp and display it in my imageview. how to store those image files in locally and retrieve whenever […]

Login Screen using Storyboard

I am new to iOS 5 and trying to write my apps as pure iOS 5 app using the new storyboard feature. I have a start screen (Login Screen) so I do not want to use navigationcontroller because i don’t need any user to go back for a log-in screen after log-in successfully moreover, i […]

Get image pixels using mask

So i have some original image. I need to get and display some part of this image using specific mask. Mask is not a rectangle or a shape. It contains different polygons and shapes. Are there any methods or tutorials how to implement that? Or from where to start to make this? Shall i write […]