iphone

How to access and use the "plist version" information in a Property List file

I'm currently using *.plist files for my iPhone app to store information that is later read into strings as NSArray or NSDictionary equivalents. I will be updating these files periodically and downloading them to the application if a new version is found. I would like to use the <plist version="1.0"> string located in each *.plist file...

Push UIImagePickerController to the left

I am making a camera app, which gives the user access to the Photo Library. They touch the button, and UIImagePickerControllerSourceTypeSavedPhotosAlbum pops up using presentModalViewController. When they touch a photo, I want a view to push the ImagePicker to the left and the new view to come in. The thing is, I want to keep the ImagePi...

Objective-c asynchronous communication: target/action or delegation pattern?

Hello folks, I'm dealing with some asynchronous communication situations (Event-driven XML parsing, NSURLConnection response processing, etc.). I'll try to briefly explain my problem: In my current scenario, there is a service provider (that can talk to a xml parser or do some network communication) and a client that can ask the servi...

dynamic calculation of UILabel width in UITableViewCell

Hi everyone, I am building a custom, in-application settings view based on UITableViewCellStyle1 (or so). I'm trying to dynamically calculate the width of the left label (title) of a cell in order to determine how wide my text field on the right can be. When I launch the app in the simulator and the view loads, the width of the title la...

NSXMLParser - Parsing special chars in XML

Hi, I'm currently learn iphone app programming. Its an xml parsing app. In XML, I have an entry as follows: <text box-opacity="0.75" boxrcolor="1.0" boxgcolor="1.0" boxbcolor="1.0" boxalpha="0.75" textrcolor="0.00" textgcolor="0.00" textbcolor="0.00" textalpha="1.0" show-box="true"> Once upon a fliegen über time, there was an old...

iPhone prevent rotation of keyboard to landscape...

So, I'm putting some controls over an MPMoviePlayerController and I'm intending this to be used in portrait mode, simply by using video that is shot vertically. My only problem is that for text entry the keyboard comes up in landscape. Now, I realize that there is an undocumented way to set the orientation of the player, but I'd rather...

Why are my y coordinates in reverse

So I am trying to render my program in landscape mode... however I am coming across something that I am having trouble wrapping my mind around. In order to move down on my map I have to have a negative offset. If I keep the current positive yOffset of 100 then the map scrolls down instead of up. Why is this? I'm not happy having to pu...

iPhone Target Linking Error

So I'm getting this error on build: This obviously has something to do with linking, but I just can't get what exactly. I have 2 targets, and I only get this error when I compile for the device target (other target is for simulator use). I compared the linking settings for each target and everything seems fine. InfoView is the last c...

acessing to iphone camera data only with API

Hello, I would like to access in real time to the data of the camera to get the hue of several points in order to guide the user (inform him when is the best moment to take the picture). The application will be probably available on the appstore and then I want to just use allowed API. I've seen a lot of similar topics, some of them tel...

replaceObjectAtIndex array problems

Been searching for the answer to this for a while now and I think due to the nature of my array set up, I may be searching for the wrong answer! I have a class which handles adding items to my array: // Item.h @interface Item : NSObject { NSString *name; NSNumber *seconds; } @property(nonatomic,copy) NSString *name; @property(...

How to modify iPhone plist to add another level and access data in code

I have a plist with an alphabetical indexed list of entries. I now want to add a further level so that each entry has a definition text (like a small dictionary.) I need some advice as to how to modify my plist and code to accommodate this. The existing code is below - it's from the Apress book, but I can't seem to modify it for another ...

trackPageView on Google Analytics for iPhone Not Working

I'm trying to get Google Analytics working on an iPhone application without much luck. I've followed all the instructions on their website (google/apis/analytics/docs/tracking/mobileAppsTracking.html) and studied their sample application (google/gaformobileapps/GoogleAnalyticsIphone_0.7.tar.gz). When I run my application and go to Go...

Map Search Results

I am trying to provide useful information on an area to users based on a search term and their location. I thought googles geo api would return a best match list of results for a query such as "swimming+pool+'my location' that I could then place an annotation for each result in my map view but it only returns one best match location. H...

watchPosition() vs getCurrentPosition() w/ setTimeout

I need to determine a person's location within 50m. I'm wondering if I should use navigator.location.watchPostion() or call getCurrentPostion() over and over again. watchPostion() is the proper W3C API for doing what I want, but practically, it seems to be overkill. Here's my code: var map = null; var marker = null; var layer = null;...

How do I create a UIImage from a 3d transformed UIImageView layer?

After applying a 3d transform to an UIImageView.layer, I need to save the resulting "view" as a new UIImage... Seemed like a simple task at first :-) but no luck so far, and searching hasn't turned up any clues :-( so I'm hoping someone will be kind enough to point me in the right direction. A very simple iPhone project is available he...

What is Best Way to Input Decimal Numbers with iPhone SDK?

So after finally learning how to store user input into a variable, I am realizing it is rather difficult to have the user input numbers with decimals. The Number KeyPad doesn't allow a decimal part, and if I use Numbers & Punctuation it looks a bit weird. So do I have to use a number Picker to smoothly allow users to input numbers? OR s...

AppViewController and Delegate extension changed to .mm, #import "OpenFeint.h" gives error that OpenFeint requires Obj-C++

Hi, I downloaded OpenFeint version 2.3.1, unzipped and placed the OpenFeint folder inside right underneath my project in Xcode, and checked "recursively create groups if needed" (the instructions said to use groups and not a folder reference). I renamed my AppViewController and AppDelegate .m files to .mm. I followed the rest of the inst...

How to draw nil using cgcontext

I want to draw nil instead of the colors, because in the end I want the code to erase a section of the UIImageView in order that you can see what is behind the UIImageView. - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [touches anyObject]; CGPoint currentPoint = [touch locationInView:self.v...

Adding a UISearchBar on a UITableView

I have an UITableView and I did put an UISearchbar on it. What I want to achieve is that if a user is going to scroll i want the UISearchbar element to be fixed on the top, plus I want the first row of the UITableView fixed as well. Is there any sample code for this ? So far every sample I found the UISearchbar wasn't fixed at the top, ...

iphone code - change the tabBar badge value from the viewController's

Hi, I have a UITabBarController, How can I create/update the badge value of the tabBar item from my viewController ? The tabBar item's created in the ib. I connected the tabBar item to the controller using an IBOutlet UITabBar *tabBar. thanks. ...