iphone

How to make one color transparent on a UIImage?

On my iPhone app I have a UIImage instance. I want to get a derived a UIImage that is the result of the first UIImage where one of its colors (e.g. magenta) is made transparent. How can I do this? ...

UISegmentedControl Behaviour

Hey guys, A quick question about the UISegmentedControl class on the iPhone. Hopefully, some may have noticed how in its default state with 2 segments, the segmented control still will toggle even if the user taps on a segment that is currently selected. I've seen UISegmentedControls in apps that negate that behaviour and don't toggle...

UIActionSheet - Unknown Number Of Buttons, How to know what to call?

Hey guys, I have a UIActionSheet with an undetermined number of buttons. I'll need to use the delegate method buttonClickedAtIndex: (or something similar) to decide what method to call when the user clicks a button. The problem is: how do I decide which button is clicked when different buttons will appear at different indexes in differ...

Performance counters on the iPhone

I'm trying to find the best method of incode performance monitoring on the iPhone. On a windows platform I would use the following functions : QueryPerformanceCounter((LARGE_INTEGER *)&ctr); QueryPerformanceFrequency((LARGE_INTEGER *)&freq); Does anything like this exist on the iPhone? Whats the highest resolution I can time something...

How to protect a name for an IPhone app?

I have my IPhone app almost ready. Now I would like to give it away to testers in ad-hoc mode. How do I protect the name of my application so that no one steals the name during the test? ...

How can I convert HTML characters to their equivalents on the iPhone?

I want to convert: &lt;?xml version="1.0"?&gt; &lt;Company&gt; &lt;CompanyId&gt;5&lt;/CompanyId&gt; &lt;Name&gt;Acme Inc.&lt;/Name&gt; &lt;/Company&gt; To: <?xml version="1.0"?> <Company> <CompanyId>5</CompanyId> <Name>Acme Inc.</Name> </Company> on a iPhone. But I can't find any standard functions availabl...

Cocoa/iPhone: How do I create a Simplified Chinese localization of my app?

I'm in the middle of localizing my iPhone app, and I've gotten English, French, German and Japanese localizations working without any problems. Now I'm trying to get a simplified chinese localization working, and no matter what I try, the chinese .lproj bundle just won't be used when I have the phone set to simplified chinese. One probl...

iPhone orientation

The possible values for UIDevice.orientation include UIDeviceOrientationFaceUp and UIDeviceOrientationFaceDown. While it might be useful to know that the device is flat, this doesn't tell us whether it's flat displaying an interface oriented in portrait or landscape mode. Is there a way to find the current orientation of the GUI in ca...

AppStore: changing the icon after the app is published?

My app is already available on the appstore, but after getting some feedback I'm having second thoughts about the icon. I know the large version of the icon is supposed to look like the device version. But what if I upload a different one, without changing the binary icon, now that the app is already published? Will the itunes folks get...

Incompatible pointer type: How can I use a CFType derived object within NSObject derived collection objects?

I'm trying to use ABRecordRef within an NSMutableArray, but it doesn't seem to work. I know that ABRecord is a C class, but I thought that ABRecordRef was the work around Objective-C class that allowed me to use it with NSObjects. What do I need to do to make this work? ...

Tab Bar Issue: -[UILayoutContainerView hash]: message sent to deallocated instance

I seem to be dealloc'ing something like the tab bar itself, navigation controller, or ???, and this happens when I go to a particular view controller and then hit the tab bar to a specific tab (eg, if I hit the middle tab, of 3 tabs, no problem, but if I hit the rightmost tab I get the crash). My program is basically complete and I have ...

Utility Application infoButton Stays on Top

Hey all, I used a utility application template to create my application, but I am using a UIImagePicker to pick some photos. The little infoButton, the i with a circle around it, shows up when the picker is displayed. If the infoButton was not in another class then I could call infoButton.hidden = YES; and it would hide it. Any ideas how...

toggling proximity sensor on iPhone loses an event

I'm using setProximitySensingEnabled and implemented proximityStateChanged in my UIApplication subclass. It looks like if sensing is toggled, that the first "off" event is being lost. My UIApplication class is pretty basic... -(void)proximityStateChanged:(BOOL)state { NSLog(state ? @"ON" : @"OFF"); } In my application delegate, I ...

How do you handle Domain Objects in an iPhone application?

I've got a few apps under my belt now, but I'm still relatively new to this. I'm looking for best practices advice or even a feature of the Cocoa Touch framework that I wasn't aware of, if anybody knows it. In the 1st app, I created Domain Objects in my Application Delegate, then would pass them off to my ViewControllers as needed. Fo...

How do I programatically make clicking on a UIImageView do something on the iPhone?

I have programatically added a UIImageView. How do I make it send a message to my controller when the users clicks it, sending itself as the only parameter? ...

Function Variable passed to setTimeout not working??

Can anyone tell me why this isn't working? function changeBG(element_id){ document.getElementById(element_id).className= "arrowActive"; setTimeout("document.getElementById("+element_id+").className= 'arrow'", 300); } In firebug I get an error saying that the element_id passed to setTimeout() is not defined. ...

Syncing objects between two disparate systems, best approach?

I am working on syncing two business objects between an iPhone and a Web site using an XML-based payload and would love to solicit some ideas for an optimal routine. The nature of this question is fairly generic though and I can see it being applicable to a variety of different systems that need to sync business objects between a web ...

Is it possible to have a TextView without a Keyboard?

For the particular application I am developing the built in keyboards are useless for me (I need to support 0-9 and X, del and nothing else). I also am after a UI with large buttons to make it easier to hit the keys. It is easy enough to come up with a UI with the buttons, but I cannot figure how to make it so that the keyboard doesn't...

[iPhone] Is current graphic only available in view's drawRect: ?

I tried invoking UIGraphicsGetCurrentContext() in other places other than in drawRect. It give me a NULL. Is it true that I can can only get current context in UIView's drawRect: only? ...

magnifying moving images

hi, im developing a 2d game on iphone in which i want to maginify the views on the screen to give the effect that the user is looking through the sniper whenever the user taps the screen.. i am required to show that the objects which the player wants to shoot should be moving...so im incremeting their position as well as increasing their...