iphone

Singleton: Where to create instance?

Does anyone have any preferences or comments about using either ... static id sharedReactor = nil; +(id)sharedInstance { if(sharedReactor == nil) sharedReactor = [[super allocWithZone:NULL] init]; return sharedReactor; } OR: static id sharedReactor = nil; +(void)initialize { if(sharedRandomReactor == nil) { sharedRandomReactor = [[...

Facebook Connect for iPhone: How to upload an image (UIImage) to user's wall without having to use json-embedded link or photos.upload?

Is there any way to upload an image (UIImage) directly from an iPhone app to a user's wall/feed? All the samples I see are either using a json-embedded link or they use the photos.upload call with album ID (aid) which results in the user getting the image in his photo album(s). What I want to do is to upload an (UI)Image created (by th...

How do you represent a normal or texture coordinate using GLshorts?

A lot of suggestions on improving the performance in iPhone games revolve around sending less data to the GPU. The obvious suggestion is to use GLshorts instead of GLfloat wherever possible, such as for vertices, normals, or texture coordinates. What are the specifics when using a GLshort for a normal or a texture coordinate? Is it poss...

How can we get kCAOnOrderOut to work?

The Apple documentation claims that the Core Animation action key kCAOnOrderOut has one sole purpose: to animate a layer out of sight when it either becomes hidden or has -removeFromSuperlayer called on it. I'm only referring to the latter case in this question. In practice, when -removeFromSuperlayer is called, the layer is removed imm...

iSimulate Automatic Hooks

I was wondering if anyone knew how iSimulate automatically registers/hooks itself into a debugged iDevice application? It's as simple as including the static library (and a couple of frameworks) and it just works. There are no methods or functions to call. How is this possible? ...

UIViews firing an action in another UIViewController

Hi My iPhone app is made of of a main tabController with 4 main tabs. I have a situation where ViewController A loads ViewController B (using pushViewController). I now need to get back to ViewController A and and trigger an action on A from B. Getting back to A is easy all I have to do is :- self.tabBarController.selectedIndex = ...

Realtime formatting with NSNumberFormatter in a UITextfield

I have UITextfield where a user can put in a dollar amount, I would like the textfield always to be formatted with two decimals ($ .##). The formatting has to be maintained all the time. But i'm stuck on how to append the entered numbers to existing ones in the textfield ? //This delegate is called everytime a character is inserted in ...

HTML5 Cache manifest file itself is not cached, and called at each resource load

We have a web app that runs on the iPhone.The manifest file is ok, and the resources(html, css, js) are cached correctly.The page sits in the home screen. The trouble is, when the page loads a resource from the cache, there is as well a GET call to the server to read the Cache Manifest file.The server is configured to send the correct h...

Nested CALayers not picking up perspective tranform

Hi, I'm trying to make use of CALayers to create a 3D style effect in one of my applications. However, it seems that nested CALayers do not have perspective applied to them. To illustrate with pseudo-code, if I have a layer with perspective applied like so: CATransform3D subLayerTransform = CATransform3DIdentity; /* set perspective */...

How can we manage the transaction using skrequest in iphone ?

HI all, I want to make some transaction using store kit framework.what's the wrong going on with me is when i make transaction than it repeated it itself do the transaction more than one time and i need just for once.I tried to release the transaction queue array but after doing that the app get crashing . can anybody suggest me the w...

How can I detect a touch on an animated subview ? Or click an animated UIButton?

I have a view that is moving. The view is sometimes on and sometimes off screen - it is twice the width of the screen. In this view, there are buttons that I need to be able to click. I've tried doing this in many ways already - using pure buttons using touches began on UIView I'm doing the animation using a CGPath in core animation ...

iPhone Mapkit Blue Dot / User Location Region Zoom Question

Hey All, Is is possible to set a region based on a current location in a mapview only one time. I want my iphone app to get the current location, zoom into that current location, and then allow the user to scroll around. However, because my setRegion code is in my didUpdateToLocation function, every time the current location is updated...

Possible to use SaveVideoAtPathToSavedPhotosAlbum and still maintain 3.0 backward compatibility?

The function SaveVideoAtPathToSavedPhotosAlbum is only available with the iPhone SDK 3.1 or above but we want to maintain backward compatibility with 3.0 devices. How can this be done? At first we though we can do a runtime check, but it turns out that this can't even compile against the 3.0 SDK. We are getting the error "_UISaveVid...

Iphone call method from another class

I have a multiple XIB file project. I have a switchViewController class that handles the switching of content views. I want to call the methods in this class from other classes. I have the following code: //SwitchViewController.h Code: #import <UIKit/UIKit.h> @class MainMenuViewController; @class GlassRepairsViewController; @inter...

Problem to convert string binary (64 bits) to decimal (c++ in iphone)

Hi I have a problem converting a string binary to a decimal I was using bitset bitstring ="1011010001111111"; unsigned long binToDec( string bitstring){ bitset<32> dec (bitstring); return dec.to_ulong(); } All of this works fine, but !! the problem comes when i try to do the same with a bits string with more of 32 bits. I kn...

How to add multiple buttons to a NavigationBar?

Ok, so I've successfully added a rightBarButtonItem to call a custom selector (called from a UIViewController), as follows: UIButton* infoButton = [UIButton buttonWithType:UIButtonTypeInfoLight]; [infoButton addTarget:self action:@selector(showInfoView:) forControlEvents:UIControlEventTouchUpInside]; self.navigationItem.rightBarBut...

Design UI programmaticly

Hi there I'm trying desperately to design my UI programmatically. But I think I'm in trouble to understand the concept. Basically I want a UI which contains different UIViews and a UITableView. But now I'm stuck with the UITableView... So my "main view" which should contain all these views is called AddListViewController(it inherence ...

Programmatically hook up events to methods?

Is there a way to hookup a button click to a method programmatically? It would be like imitating the CTRL+CLICK in Interface Builder. ...

APNS strange feedback

Hi I'm getting strange feedback from the feedback sandbox server. Actually there should be only my device registered so I expect always the same device token (which I already know). Anyway... I'm getting every time a different device token and always the same timestamp "Wed Mar 04 02:46:40 +0100 1981" Is that normal or is there somethi...

Fixing form action when using iUI and Rails

Run into a bit of a problem when submitting a Rails form while using iUI. When submitting a form using the form_for helper in Rails, it jumps to a new separate page and loses it's original formatting. This is a problem for iUI which uses some fancy javascript/css etc to give the web app a nice native iPhone feel. Anyone got any ideas? ...