iphone

how to declare a external integer variable so that i can access that in in view controller

i want to access variable in all views ,so how can i declare it .... ...

How can I connect an IBOutlet from my code to two different objects in interface builder

I'm using the iPhone SDK 4.0 and I want to connect IBOutlet UIImageView *block; to more than one image on the view in interface builder. However, whenever I try and link the second image, the first image becomes disconnected. How can I connect two images to the same IBOutlet code? ...

Parent view -> Subview -> button -> subview method

Hi all, I have a parentview with a ui view on it. This loads a subviewcontroller on viewdidload. The subviewcontroller has a button on it that is linked up on touch up inside to a subviewcontroller method called clicked. This causes a bad access error to fire and crashes the app. My question is, is this setup possible or do I have to h...

MKMapView not alway call the delegate to show the annotation

I have a mkMapView with one annotation. The first time every thing is OK. The application call the delegate - (MKAnnotationView *)mapView:(MKMapView *)theMapView viewForAnnotation:(id )annotation {...} and my annotation is working fine. When I need to change to a new map location (with a new annotation) the old one is release the new an...

how to retrieve objects from NSArray by their tags in iPhone SDK

Hello, I'm using an NSArray of images, and each image has a tag. I want to know how to retrieve these images from the array using their tags. Any input would be appreciated. Thanks. ...

Capturing current location and calculating distance

Hello, I've been looking at this for a while. I've found plenty of posts and looked at the documentation but I'm having trouble getting it working. I have core location implemented, and its working with no problems i.e. NSLog(@"Description: %@\n", [newLocation description]); The description details are displayed in the log. I want t...

Adjusting the width of a UILabel in UITableViewCell based on the width of a second UIView in the Cell

Hi, I have a UITableViewCell with two subviews, a UILabel on the left, and a random input control on the right. The random input control on the right can vary in size, as can the length of the text, but since I can set the word wrap of the text on the left, I need to be able to adjust the size of the UILabel based on the width of the ra...

MKMapView setRegion "snaps" to predefined zoom levels?

Can anyone confirm that setRegion "snaps" to predefined zoom levels and whether or not this behavior is as designed (although undocumented) or a known bug? Specifically, it appears that setRegion snaps to the same zoom levels that correspond to the zoom levels used when the user double-taps the map. I'm trying to restore a previously sa...

iPhone iPad UIView controller popup centered

Hi there, My application is for iPad. I have a UIViewController as the main view of my application. I have an UIView at the bottom as a footer, and inside 3 UIView (subviews). My 3 subviews in the footer banner load for each a different UIViewController and display the view of this controller into their view. I would like when I clic...

iPhone Native Stocks Application

Anyone know how apple uses yahoo finance api to get the historical data for stocks at different times of the dat. Also, how to get the quote price for a given stock at different times of the day for today instead of just the current quote? It seems that the yahoo finance api can be used to get the current price, and the iChart.yahoo.. c...

App loads on iphone4 but not on 3g..nil string parameter

Hey All, Please help..I am unable to figure out this wierd problem. My app has iAds and multitasking support. The app can be deployed onto the iphone and its running pretty fine but when I tried to deploy my app on iphone 3g(with iOS 3.1.2) it throws the following error on the console. I tried commenting out the code for iAds but not sur...

accessing settings from subviews

The iphone app I am creating has an array of commonly used settings. These settings will likely be changed frequently by the user and are pretty small, so I am using archiving to store a small array of objects. My top level view is a series of buttons (for UI design reasons) and not a tableview. These settings are used within one subview...

iphone UIBarButtonItem initWithImage - doesn't highlight when tapped

I can create a button like this, and the action works fine: UIBarButtonItem *myBtn = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"image.png"] style:UIBarButtonItemStyleBordered target:self action:@selector(myMethod:)]; However, when tapping the button on screen, no Down state highlight is displayed. I've tried everythi...

UITabBarController Initial View?

Hi, I'm wondering if it is possible to start my app with all my tabs in the "up" state and show a "landing" view to the user. Kind of like a welcome/quick start. When they select one of the tabs, it switches views as normal. Will you point me in the right direction? Kind of like this: ...

Lauching App with URL (via UIApplicationDelegate's handleOpenURL) working under iOS 4, but not under iOS 3.2

I have implemented UIApplicationDelegate's application:didFinishLaunchingWithOptions: and application:handleOpenURL: according to specification, i.e., application:didFinishLaunchingWithOptions: returns YES and application:handleOpenURL: opens the URL. The code works under iOS 4 (in both cases, i.e., when the app is launched and ...

Discrepancy between sizeWithFont:constrainedToSize:lineBreakMode: and textView.contentSize.height

Hello, I am using the method [string sizeWithFont:constrainedToSize:lineBreakMode:] to estimate the height of a textView that I am resizing. However, it seems to consistently return the incorrect size. To debug, I wrote the following code: self.textView.font = [UIFont systemFontOfSize:14.0]; // It was this before, anyways NSLog(@"Real ...

Core Data: NSManagedObject adding values "forKey" - NSNumber truncates. Alternative?

I understand that NSNumber cannot go beyond 1/10ths place. What can I use as an alternative to add a doubles (longitude/latitude) into Core Data? Using double directly does not work and NSNumber truncates the value. NSManagedObject *newManagedObject = [NSEntityDescription insertNewObjectForEntityFor...

Can you provide a hint to a mobile device that an HTML input field is numeric-only?

I've been doing some usability testing on a website I'm developing, using an Android phone and an iPod touch. In both cases, when entering a numeric field (time, distance in metres, etc) I have to take a manual step to change the keyboard layout to show digits. As the app will only accept numeric values in the textbox, I'd like to save...

Editable Grouped UITableView

My designer wants me to implement an editable grouped tableview with functionality similar to what you see with 'ABNewPersonViewController' in the Contacts application where there are segmented table areas with add/delete buttons, etc. Is this a standard way to edit information that is viewed in grouped tables? If so, are there any goo...

UIScrollView does response to touches in iPhone

Hello, I have a scroll view with images inside it and I'm using touhesBegan, touchesMoved, and touchesEnded to tap on an image to enlarge it. But It does not seem that the scroll view is responding to touches at all. I tried most of methods in similar questions but still does not work. I have been working on that for long so please an...