iphone

Get selected row in UIPickerView for each component

Hi all! I have an UIPickerView with 3 components populated with 2 NSMutableArrays (2 components have the same array). A tutorial says: //PickerViewController.m - (void)pickerView:(UIPickerView *)thePickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component { NSLog(@"Selected Color: %@. Index of selected color: %i", [arra...

NSDictionary. How do I create directly from aformated file?

This is a fairly trivial data parsing question. I'm just unclear on the methods I should be using to pull it off. I've got a plain text file of a few hundred lines. Each line is of exactly the same format. The lines are in contiguous chunks where the first item in a line is essentially a key that is repeated for each line in a chunk: k...

addAnnotations issue (memory management maybe?)

Hi guys! I'm having some problem with MKMapView / annotations / UINavigationController. Basically, i manage my views using a UINavigationController; one of my view contains an MKMapView and i add annotations on it (10 to 200) using the addAnnotations method. Everything is working fine except for one thing : if i navigate "too fast" on m...

How to set "User Interaction Enabled" on UITextViews in code

I have the following problem: I got a view with two text fields and a UITextView (non editable, but scrolling) to show some infos. When the keyboard is shown I slide the whole view up so both text fields and the keyboard are shown. When the user clicks outside of the text fields I hide the keyboard and move the view back down. This work...

MKAnnotationView in both hovering and pinned states

I'm trying to add a pin (MKAnnotation and MKAnnotationView) to my MKMapView and allow the user to drag it around. I'd also like to make the dragging of the pin animated and interactive like the iPhone's Map App. My question is how do I change the state of the MKAnnoationView so that it's hovering over the map (so the pin isn't actually...

iPhone programming: Sending data from one iPhone to another?

Hi, I am new to iPhone development. I created an iPhone application, using which user can create a Business Card kind of UI in TableView. I want to know how can i send a Business Card(which i created programmatically) data into another iPhone via SMS? I want to know the technology which i should use to sending such thing from one iPhone...

how to load mp3 in Music application to my iphone application?

is it possible?i know have some of the apps can get the mp3 from there but how to? ...

Calling a method when UITabBar is selected?

Hi all, I'm currently writing a app on the iPhone and was just wondering if anyone knew a way to call a function but only when a tab is selected. I have a separate view controller for the tab in question and I want to call a function which updates the GPS position when the tab is selected. If anyone could help that would be great :) ...

iPhone > Set position of an control

Hello, I'm currenly learning Obj-C and try to find the easiest way to set a position of an control. So this works to set the object +100px: [panel setFrame:CGRectMake( panel.frame.origin.x, panel.frame.origin.y + 100, panel.bounds.size.width, panel.bounds.size.height) ]; But of course this is painful. Unfo...

What's wrong with this code? Help please!

I have been trying to write an image on a layer using Quartz but all I see is totally empty images... this is the code CGContextRef context = UIGraphicsGetCurrentContext(); CGRect backRect = CGRectMake (0, 0, image.size.width, image.size.height); CGLayerRef backLayer = CGLayerCreateWithContext (context, image.size, NULL); CGContextRe...

Why isn't my UIViewController in the responder chain for its view?

I have written a subclass of UIViewController which creates a view programmatically, instead of loading it from a NIB file. It has a simple loadView method: - (void)loadView { UIScrollView *mainScrollView = [[UIScrollView alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; self.view = mainScrollView; [mainScrollVi...

Twitter + OAuth + iPhone = fustration

I'm trying to implement http://github.com/bengottlieb/Twitter-OAuth-iPhone/tree/master into my code. I'm following the Demo provided and I can't seem to get it to work. Here is where I think the problem is currently. So the example declares a view controller that handles the OAuth Connections and such in the app delegates header like so...

How to set parentViewController in UIViewController?

The parentViewController property of UIViewController is readonly, but I am nesting custom view controllers and would like to use this property. However, since it is readonly, and I found no other way to set this property, my quesion is: how do I set it? Obviously, UINavigationController can set the property somehow in -pushViewContro...

iPhone add icon in status bar (a la Battery Indicator)

Hi all! I was wondering if it is possible to add an icon to the iPhone status bar, much like the battery and wifi indicator. How can I do this? Thanks. ...

iPhone SDK: saving large amounts of text

I want to save large amounts of text then display them (first in table view, then in text view), however I am unsure which method to do it in. Should I use SQLite, or one of the archiving methods. ...

How do you parse with SAX using Attributes & Values to a URL path using iPhone SDK?

I'm trying to get my head around parsing with SAX and thought a good place to start was the TopSongs example found at the iPhone Dev Center. I get most of it but when it comes to reaching Attributes and Values within a node I can't find a good example anywhere. The XML has a path to a URL for the coverArt. And the XML node looks like thi...

How to implement customize editing info in UIIMAgePickerController

How to implement customize editing info in UIIMAgePickerController? Means i have done editinginfo=no in UIIMAgePickerController.And i want to make customize editin info in my application?How to make? ...

iPhone how do I know when the user is touching the screen but not moving?

I want to know when a user is touching the screen but not moving. Doing it in a pseudo fashion is simple enough - I know how many touches I have just by using touchesBegan and touchesEnded, but the problem is that only touchesMoved sends events. No events are sent if you aren't moving. This is being used to have a nice sliding scroll - y...

Specifying a non-fullscreen OpenGL ES view

Hi, Anyone know how to create an OpenGL ES app that doesn't use the full iPhone screen dimensions as its drawing surface? Everything I've seen so far has the EAGLView (or whatever) drawing to 0, 0, 320, 480. I'd like to have my EAGLView at 100, 100, 100, 100. Is this possible? It seems all I'd need to do is change the glViewport() c...

Is there a way to synthesize setters/getters for class variables in Objective-C?

I find myself declaring bunch of class variables and it is really tiring to write simple get/set methods for each variable. So, the question is how to synthesize setters/getter for class variables in objective-c? ...