iphone

iPhone Disabling UIActionSheet buttons

I want to disable buttons in the UIAction sheet and enable them after a certain condition is true. How do I achieve this? Any ideas? ...

ObjC - Post a UIImage by using NSData and NSURLRequest?

Hey all, I'm trying to post an image to TwitPic.com using their API. However, I have never posted an image using HTTPPOST or however else before. Anybody enlighten me to how I can post NSData from a UIImage using their api? ...

how to save image to abaddressbook?

Just simulate the native contacts app function - Take a photo from cam and save it to abaddressbook by using setImageData somehow the size and format stored in abaddressbook is a bit different then the one in album It's square and i think there is two copies of them in address book. -one is square which is shown in the contacts image...

Why do I get poor performance when rendering different images with UIImage on iPhone

Hi, I'm using UIImage to render a game map from 32x32 blocks. The code is as follows for( int x = 0; x < rwidth; ++x) { for(int y = 0; y < rheight; ++y) { int bindex = [current_map GetTileIndex:x :y]; CGPoint p; p.x = x * tile_size_x; p.y = y * tile_size_x; [img_list[bindex] drawAtPoint:p]; } } This ends up rendering abo...

Possible to redirect using only webpage?

I have a UIWebView that loads a URL through loadRequest in viewDidLoad. The user clicks a button in the RootViewController, which pushes the webview and a webpage appears. With only access to the webpage code, is there a way to redirect the user? I tried the META Refresh but that didn't have any affect. Links won't work since none o...

NSString contains a number, why does it crash my App?

I'm having some difficulty with NSString in my application. Basically, I have an NSString called o1string which contains the value "602". I want to output this in a UIAlertView alongside some other text. votedmessage = [ NSString stringWithFormat:@"The current standings are as follows:\n\n%@: %@ votes", b1title, o1string ]; UIAlertView ...

Is it possible to connect two iPhones over a WAN for a real time gaming experience?

Is it possible to connect two iPhones over the web (wide area network) for a real time gaming experience? Would the connection be fast enough for a game (for example) like pong? What steps should I take? What type of objects int the iPhone SDK should I employ to make this happen? If you are voting to close please at least leave a commen...

iPhone SDK: How can I determine the last active tab in a TabBarController?

One of the tab bar controller tabs in my iPhone app changes what it displays based on where the user arrived from (which other tabs). For example, if the tabs are A, B, C and D, the C tab will display a picture if the user was previously on tab A, but text if the user was previously on tab B. I'm not sure how to implement this withou...

What are Layers good for? What could I do with adding an Layer, and why should I think about Layers?

I am wondering what makes Layers different from Views, when every View comes along with it's own Layer. Maybe I am wrong with that. But then: What are these Layers good for? Like I understand it, I would use an UIView to group elements in my GUI. I could also use that UIView to position things over other things. So where come Layers int...

Maps API for looking up businesses near co-ordinates.

Hi, I'm currently working on an iPhone application to take GPS coordinates to find the closest electronic stores of my choosing and display them to the the user. I'm familiar with http://stackoverflow.com/questions/683817/google-maps-find-nearest-utilities, but this isn't exactly what I'm looking for. It's also a javascript API. I'd pre...

Displaying a UIView over the UIImagePickerController to capture user touches

I have a problem where I need to display the UIImagePickerController as a camera view and capture swipes on the user's screen. Currently I display the imagePicker in my custom view controller, then call its presentModalViewController for the camera. Once the camera is displayed, I insert a view on the top to capture the user's swipe gest...

Add label to UITextField

In question 663830, Isaac asks about adding a button to a text field. Can someone show code to add a label to the .rightView property? Or, is there some better way to include 'permanent' text in a text field? This is for a calculator that would include units in the field (mg, kg, etc.) without having to maintain a label outside of the ...

error with import <cocoa/cocoa.h>

I added class files from another project to my new iPhone Window for the first time. The class is a simple class that defines a polygon, and subclasses NSObject. As part of the standard template for an Objective C class, this class definition imports Cocoa.h #import <Cocoa/Cocoa.h> However, just by adding this class, I'm getting a...

How to properly call SQLite functions from background thread on iPhone?

I'm using an SQLite database in my iPhone app. At startup, there are some database actions that I want to perform in a separate thread. (I'm doing this mainly to minimize startup time.) Occasionally/randomly, when these database calls are made from the background thread, the app will crash with these errors: 2009-04-13 17:36:09.932 Act...

How do you escape a file system path for the iPhone?

Hey everyone, Is there a system library for escaping a file system path for iPhone development? I have to read and write files where the file name is based on 3rd party values so I want to make sure the paths I'm actually writing to are nice and safe. I would have thought there was an NS library that would do this for me, since this is...

Custom easing action with Cocos2D-iphone

How would one go about creating a custom action in Cocos2D that was able to perform a 'callback' over time, making each call to the callback progressively longer than the last call to it (using something similar to the EaseExponentialOut action already provided with Cocos2D. Something similar to this: (which does not work) id sequence ...

How do I kill loops in Xcode?

I've been writing/debugging in Xcode and every now and then I accidentally create a loop that I can't stop. Unpasuing debuging and rebuilding (and Go-ing) doesn't help, nor does any of the normal Ctrl-C stuff that I'd use on a normal CLI. The only thing that does the trick is quiting Xcode. Odd question, I know, but any ideas? ...

Is it better to start how to code in Objective-C for the desktop before you venture to the iPhone?

I have C/C++ experience so learning Objective-C is not completely foreign to me. However, I noticed that writing an application for the iPhone is not as simple as for the desktop platform. Should I start to get some solid experience on the desktop before I jump into the iPhone? I am not a commercial developer, and merely doing this as a ...

iPhone - saving current view as image

Hi How can I save the current view as an image to Camera roll from my application? Is it possible? Thanks. ...

How to lose margin/padding in UITextView?

Hello, I have UITextView view in my Iphone application which displays large text and I am paging that text with offset margin, but the problem is, that it has some kind of margin or padding and it messes up my calculations (it seems to be diffferent depending on font style). Is it possible to get rid of that unnessecary space around UI...