iphone

in response for which method rotate an image in iphone with a finger?

Hi all! in response for which method rotate an image in iphone with a finger? I have such code, but I dont know in response to which method can I call it. thanx! UIImage *image = [UIImage imageNamed:@"image.png"]; UIImageView *imageView = [ [ UIImageView alloc ] initWithFrame:CGRectMake(0.0, 0.0, image.size.width, image.size.height) ];...

Storing data on iPad

My application needs to store a list of airports. This list needs be setup manually i.e. its not coming from a web service. I am thinking of creating a Core Data database and then inputting this list myself. This Core db will then ship with the App. Would you recommend any other ways of doing this? Should I perhaps rather use an XML...

How to slide(push) controls down/up in a View?

Hello folks! I have a button which when pressed, should push the controls below it down and show textFields on the space freed. Basically, just changing the position of these controls in an animated way. Any ideas/tips on how to do that? I tried the code in: How to Make a UITextField Move Up When Keyboard Is Present But couldn't get i...

If statement in Xcode to determine which HTML page is being loaded by a UIWebView

Hi guys, I have a UIWebView on my interface and I have added a UIToolbar with a next button and previous button. When I press the next button, I want the WebView to load a different HTML page. BUT I also want to run an if statement to determine which HTML page the WebView currently has in it. So For example. If the UIWebView has index...

iphone - change pointer reference to a new object and clean old

NSMutableArray *myArray = [[NSMutableArray alloc] init]; MyClass *obj1 = [[MyClass alloc] init]; [myArray addObject: obj1]; How to clean the old obj1 reference here, if I want to reuse the variable name. Without destroying anything in the array. obj1 = nil OR [obj1 release]; // What is the differences? obj1 = [[MyClass alloc] in...

UIInterfaceOrientation bug ?

In my iPhone app I need to detect the current orientation and I have to determine if I'm in portrait or landscape. I use this code: UIInterfaceOrientation orientation = [[UIDevice currentDevice] orientation]; if (orientation == UIInterfaceOrientationPortrait || orientation == UIInterfaceOrientationPortraitUpsideDown) { NSLog(@"port...

Problem with MKAnnotation image property

Hi all, I am implementing a MKMapView based application. In that I am using a custom image instead of displaying a pin by using MKAnnotationView.Image property. It is working fine. But I had a problem with pin display it is showing in the ocean. When I used default pin it works fine. I don't know what is the problem. Can you guys please...

Retain count after creating NSString

Hello Friends, I am creating a object which is type of NSString by the below method NSString *str = [[NSString alloc] initWithString:@"aaaaaaaaaaaaaaa"]; NSLog(@"retain count == %d",[str retainCount]); after that i just printing the retain count value which is 2010-10-29 17:04:03.939 Example [1580:207] retain count == 214748364...

Overriding layoutSubviews when rotating UIView

When rotating a scroll view inside a UIView, the scroll view doesnt position correctly using its default autoresizing behaviour. Thus, when rotation occurs, in willRotateToInterfaceOrientation i call [self.view setNeedsLayout]; and my layoutSubviews method is as follows: - (void)layoutSubviews { NSLog(@"here in layoutSubviews"); }...

Why I get "implicit declaration of function 'PerformXMLXPathQuery'" warning?

Why I get "implicit declaration of function 'PerformXMLXPathQuery'" warning? NSString *response = [request responseString]; NSString* xPathQuery = [NSString stringWithFormat:@"//ExtendedData"]; NSArray* myArray = PerformXMLXPathQuery([response dataUsingEncoding:NSUTF8StringEncoding ],xPathQuery); ...

How to display list of values in Iphone programming except using UIPickerView?

Hi, In my app I have four fields and each of them is list of values. Now if i use a UIPickerView with 4 components then the whole View becomes too congested and ugly for the user's liking. Is there any better and cleaner way to display these list of values? Please Help & Suggest. Thanks!! ...

how to avoid that callback is sent to deallocated instance

The following process leads to a crash of my app: the user opens a view and a request is send to the server the request is executed in background the user navigates back to the root view the request has been finished and the following code is executed // MyDatasource.m // e.g. in connectionDidFinishLoading [callback loaded...

What's the best way to connect iPhone app (iOS SDK) to php/MySql backend

Hey guys, New to iPhone dev here. Just wondering what's the best way to connect an iPhone app frontend (based on Cocoa) to a php/MySql based backend? The iPhone application will frequently access and change data stored on our server. Many thanks ...

Generally speaking, do I write code that saves memory or code to save processing time for simple objects for smartphone applications?

I’m not sure this is the best example, but here goes. Let’s say I want to draw an object to a canvas in an Android application. I need to do some math and call a method to return screen size to figure out where to draw it since my app should support multiple screens. I really only need to do this procedure once, as every time I want t...

Iphone OpenGL ES Reuse or draw once Texture scene

Ok guys, so I am drawing charts in OpenGL for Iphone. And everything is ok, until I use that Texture2D class to draw X axis labels and Y axis labels. The function of drawing labels is executing at each frame which I think is time consuming. In order to solve animation slowing, I have 2 ideas, but I still can't find how could I implement ...

How to send a value to the function when clicking on the ui button

Hi all, NSString *name = @"John"; I need to pass the above variable value, when clicking on the uibutton. Currently I created the uibutton like below: sendButton = [[UIButton alloc] initWithFrame:CGRectMake(170, 350, 90, 30)]; [sendButton setTitle:@"YES!" forState:UIControlStateNormal]; [sendButton addTarget:self action:@selector(s...

xcode: convert iphone to ipad issue

I am trying to convert an iphone project to an ipad but having a build issue for the new ipad version. I was able to convert the iphone project to ipad 3.2 and run it. When I run it it shows up in the ipad simulator as an iphone app. (Which is fine) I then changed the simulator to iPad 4.1 with the new target of iPad When I do a bui...

How to create such an iOS interface?

Would you please have a look at Tipulator app: http://www.sophiestication.com/tipulator/ I'm interested in the upper graphic part of the application, how to create such an interface? It doesn't look to use standard UIKit components, it looks like pure graphics yet the values can be updated as a UIKit component. ...

All events that would trigger the applicationWillResignActive & applicationDidBecomeActive

I know pressing Command-L can trigger applicationWillResignActive: from forum here. 1) Is it only applied to IOS4? 2) Besides, in the real scenario with the device, what would trigger the applicationWillResignActive: & applicationDidBecomeActive:? I searched answers in this forum. Some said it depends the reply of a call, some said...

UIWebview works slow

Hello All, UIWebview load the content very slow. WebView=[[UIWebView alloc]initWithFrame:self.view.bounds]; WebView.delegate=self; [WebView addSubview:spinner]; [self.view addSubview:WebView]; NSString *decodeString=[@"www.google.com" stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; [WebView loadRequest:[NSURLRequest r...