iphone

Why doesn't UIButton title display?

In a UIViewController's viewDidLoad method, I do this: UIButton *b = [[UIButton buttonWithType:UIButtonTypeRoundedRect] initWithFrame:CGRectMake(0, 0, 100, 100)]; [b setTitle:@"Testing" forState:UIControlStateNormal]; [b setTitleColor: [UIColor blackColor] forState: UIControlStateNormal]; [self.v...

[iPhone SDK] Why might an array decoded from plist or JSON not respond to :class or :count while a programmatically created array does?

I'm encountering an extremely vexing problem. I have a UITableViewController which in its init method decodes a dictionary from a JSON or plist file (I've tried both), then retrieves an array from that dictionary. Later on, in the method tableView:numberOfRowsInSection:, I'm returning the count of that array. However, for reasons beyond...

Resetting the origin of a transformed UIView descends into craziness

I rotate/scale a UIVIew using [UIView transform:] and this works well. However, as soon as I change the view's frame origin the contents of the view begins to scale 'weirdly' even though I am not performing any further CGAffineTransforms. Why does this occur? How can I prevent it? Update 1: The docs suggest that the frame is invalid a...

Hi I need to write Insert Query in SQLite3 in iPhone

Hi need insert data in table if the record is not already exits Ex: IF NOT EXISTS (SELECT Id FROM table WHERE id=_Id) THEN INSERT INTO tbale(.....) This can be easily done using stored procedure in MySql. But I want to d same thing in SQLite by writing a single query statement. Pleas help ...

How can I write a complex CGPath or vector image to disk?

Can I write the bytes of a CGPathRef to disk and then read them back later? Is there an easy way to store a SVG style path to disk? I have a very complicated SVG file (~500K) that I would like to convert into a binary format for easiest storage and loading on the iphone. Looking at the svg file there are only lines and bezier curves al...

Read label for non multivalue properties in ABAddressBook (iPhone)

Hi, is there a way to read the label of non multivalue properties? For multivalue properties this is very convenient as I don't have to care about localization... but what about birthday label ? ...

iPhone SDK Push Notification

I have setup push notifications in the apple developer panel and added the code to my application. It works fine on the phone using a development profile but if I use a distribution (ad-hoc) profile so that I can give it to a few users for testing it gives an error and crashes, the log gives the following error Code: Thu Jun 25 22:22:...

Online High Scores Solution

Can anybody advise solution for implementing online high scores table for iPhone game ? I mean simple engine to publish player result by http query and view global high scores table. I'm weak in PHP so trying to find existing solution first. Thanks. ...

localizing currencies in iphone app

I am testing my app. All is working fine except when I change locales to Germany. Basically you input 2 values in your local currency, a calculation happens and the user gets info back. Users numeric inputs are handled well. That is, on "Editing Did End" a method executes that converts the number to its local currency equivalent. So i...

Get notification when NSOperationQueue finishes all tasks

NSOperationQueue has waitUntilAllOperationsAreFinished, but I don't want to wait synchronously for it. I just want to hide progress indicator in UI when queue finishes. What's the best way to accomplish this? I can't send notifications from my NSOperations, because I don't know which one is going to be last, and [queue operations] migh...

iPhone network performance

Hi all, I have a question and I am very open to suggestions (even very odd ones!) I am writing an iPhone app, which does a request (URL with parameters) to a server. As a response, the iPhone receives XML. All is well. Right now, I am looking to improve my application's speed by measuring the time it takes to perform certain tasks. I'...

create UIImageView with portion of image file

I'm subclassing UIImageView to create a tile-based application. Essentially, I am taking a single image file and breaking it up into pieces, and then assigning the pieces to my tiles (UIImageViews), so that they can be manipulated independently. What's the best way to grab a portion of an image and use that to draw a UIImageView? I th...

GameKit in iPhone SDK 3.0

So, I was wondering if you NEED to use the Peer Picker to find peers in the new iPhone SDK 3.0. I don't really want to use it but I do want to use the peer-to-peer bluetooth connection. Is there any sample code that demonstrates the bluetooth connection without using Peer Picker? The game GKTank that Apple provides utilizes the Peer Pick...

safari on iphone stops repositioning widgets

I'm working on a javascript game (written in GWT). The game works fine on any desktop browser I've tried, but when I run it on the iPhone/iPod Touch, the screen stops showing widgets moving at random times during the game. Once it stops showing movements, I can see that the game is still running, because certain actions that cause obje...

ASIHTTPRequest: Receive delegates from several requests within a network queue

Hi, I use ASINetworkQueue to send two requests, which are in a queue. My problem is, that I'm not able to receive notifications when a request fails/is done. Code: [networkQueue cancelAllOperations]; [networkQueue setShowAccurateProgress:YES]; [networkQueue setUploadProgressDelegate:self.progressIndicator]; [networkQueue setDel...

iPhone - Hide Address Bar on Page Load

Hello, I have a web page that is intended to be loaded on a person's iPhone. When the page is loaded, I want to hide the status and address bar that is at the top. I have seen other sites do this. In an attempt to accomplish this, I have placed the following code in the section of my web page: <meta name="viewport" content="width=devi...

how to get UIImageView coordinates?

Hello, I have to calculate an angle beetween two UIImageView and i don't find how to get the UIImageViews coordinates(the four corners coordinates). Is there a property for that? thanks ...

Assigning a protocol to an NSMutableDIctionary?

Hi all, I am using a singleton backbone in my application to handle accuring errors. They will be handled inside the singleton and broadcast a notification throughout the app when the error has been fixed. Anyways this is not what my question is about but when I pass a new error to the singleton object like this [[SingletonErrors share...

How do you do rounded corners with CSS on the iPhone in a UIWebView?

Doesn't seem to work for me, maybe I just doing it wrong ...

How to intercept touches events on a MKMapView or UIWebView objects?

Hello, I'm not sure what i'm doing wrong but I try to catch touches on a MKMapView object. I subclassed it by creating the following class : #import <UIKit/UIKit.h> #import <MapKit/MapKit.h> @interface MapViewWithTouches : MKMapView { } - (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *) event; @end And the implementa...