iphone

touchesBegan & touchesMoved

So here's a weird question. I have a UIImageView that responds to touchesMoved & touchesBegan, it works perfectly. The main thing I'm having an issue with is if you put your finger down on say image1 and then with that finger still down on image1 you would press image2 with your other finger. In turn this would fire image1 again. Dont ...

Why are RGB values inconsistent between iPhone and Mac OSX Color Meter (Particularly the Red channel)?

Hello! I'm programming for the iPhone and I have an 3-channel UIImage taken from the iPhone camera. I'm trying to get the RGB values for different areas on this image. I currently cross-reference the RGB outputs I get from the iPhone with the digital color meter that comes with Mac OSX. Most of the values I obtain are fine, however...

How can I use different .h files for several targets?

I have a project with several targets. For most of my classes, I can use a single .h file and change the details in the .m file (adding a different .m file for each target). For one of my UIViewController subclasses, I need to declare different UILabel IBOutlets for the different targets (each target shows a different set of labels depe...

How to set custom view for UIBarButtonItem?

I am trying to put a label in a UIBarButtonItem. Here is my viewDidLoad method: characterCountLabel = [[UILabel alloc] init]; characterCountLabel.text = @"HELLO"; charCountButton = [[UIBarButtonItem alloc]initWithCustomView:characterCountLabel]; Everything is hooked up properly in IB. Why is the label not appearing inside of my UIBarB...

NSLocale - get all available languages

is there a way to get all available languages on the iphone just like in the settings app? can't find a method in NSLocales Class Reference. thanks! ...

iPhone Objective-C: Ensure user allows location sharing before doing other actions

My application asks for location at the log in screen, and right now, the user can log in without sharing his or her location. When the user selects "No" for sharing location, an error that reads Error Domain=kCLErrorDomainCode=1 "The operation couldn't be completed. (kCLErrorDomain error 1.)" is thrown. I'm guessing that's because I am ...

UITextView: How to set '\n' from an XML-loaded string?

I need to indicated a 'new line' in a string in an XML file I'm loading. If I hard code the string: myTextView.text = [NSString stringWithString:@"Line1 \nLine2 \nLine3"]; It displays: Line1 Line2 Line3 (as expected) But if I put the exact string in my XML file: <someNode string="Line1 \nLine2 \nLine3" /> And then load it in...

What is best Way to store data locally on iphone ?

I am designing a web app that fetches data every time a user logs into his/her account. The data is an xml file containing image links and some text. I want this data (after image fetch/load from the actual link) to be stored locally so that every time an user opens the app it doesn't have to load everything from scratch. Locally stored ...

Improper Return Value using NSFileManager createDirectoryAtPath:

Hi Everyone, I'm working on a new feature for an existing iPhone application, and would like to create several new directories in the application's local "Documents" folder. I have successfully done this using the recommended method: [NSFileManager createDirectoryAtPath:withIntermediateDirectories:attributes:error:] When reading the ...

UIControl -contentHorizontalAlignment: how to use in a subclass

UIControl has two properties that are documented to affect the layout of content in the control's view: contentHorizontalAlignment The horizontal alignment of content (text or image) within the receiver. controlVerticalAlignment The vertical alignment of content (text or image) within the receiver. I have a UIControl subclass t...

XCode not showing Simulator for some projects

Can't figure it out. I have tried AppPrefs sample app a few months back, on XCode 3.2.2 and it worked fine in the simulator. Now I need to look at that sample again (XCode 3.2.3) and the pull-down menu only shows "Device" as the available option. My other projects show both the device and the simulator and can run on either. I tried ge...

iPhone: Handling touches transparently

I have a UIViewController and an associated with it UIView. The UIView has a number of subviews. How to handle touch event inside a specified rectangle in my UIViewController subclass? This handling should be transparent: UIView and its subviews should still receive their touch events even if they intersect with the specified rectangle...

When to use different cell identifiers for retrieving the reused table cells?

Just curious about the identifier used in - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath I saw some cases that people use different identifiers for different sections in the uiviewtable, generally speaking, what is the motivation for that? Is it because that, for example, secti...

how to display the list of buttons like drop down list for a button in iPhone

Hi... i am new to iPhone programming... can any body help me out please... in my app i am displaying an image, transparent html page with text about that image and there is audio instead of html text... in the bottom tool bar i have button 'VIEW".. i want this button to show the 3 (radio or normal) buttons in a list like drop up list(for...

Would I ever want to use any @property attributes other than "retain" and "nonatomic" for UI variables?

I'm diving into iOS development and I find that for each of my UI controls, I always just blindly declare their @property like so, since that's how it was done in some tutorial I read when I started learning... @property (retain, nonatomic) IBOutlet UILabel *lblStatus; I'm still getting familiar with these attribute types and what the...

Is it possible to tile images in a UIScrollView without having to manually create all the tiles?

In the iPhone sample code "PhotoScroller" from WWDC 2010, they show how to do a pretty good mimmic of the Photos app with scrolling, zooming, and paging of images. They also tile the images to show how to display high resolution images and maintain good performance. Tiling is implemented in the sample code by grabbing pre scaled and cut...

UITextField editing issue - iPhone SDK

Hi all, I am having an issue with my UITextFields in my iPhone app that I am hoping someone here may have seen before. I have a few UITextField's on my screen, and when they are tapped and they keyboard appears they are covered. To overcome this, I animated the view to move up with: -(void)moveViewUpFromValue:(float)fromOldValue toNe...

How long does AudioServicesPlaySystemSound(kSystemSoundID_Vibrate) last?

I don't have access an iPhone to test on right now. Can anyone tell me how long this call makes the phone vibrate? Thanks. ...

custom uitableviewcell

Hi , i need to create a screen which is a replication of the default iphone stock application without the scrolling on the bottom table , what would u think is the best way to replicate the look and feel of the screen ? i've created a uiview and added two uitableview setting the delegate and datasource to the same view for both of them...

Cache Progressive downloaded content in MPMoviePlayerController

Hi, I have a music player implemented in iphone (sdk 4) and it works both with streaming of Mp3 (Transcoded on the fly) or raw progressive download. Is there anyway to make the progressivedownloaded content (which I dont directly control) to be cached so it doesn redownload the whole content? Or Is there a global cache setting to contr...