iphone

Changing the userAgent of NSURLConnection

Hey I am using a NSURL Connection to receive data. [NSURLConnection sendSynchronousRequest: //create request from url [NSURLRequest requestWithURL: //create url from string [NSURL URLWithString:url] ] //request parameters returningResponse:nil error:nil ] Is it possible to change the user agent string? right now it is: AppName/...

UIImage Memory problems becoz of caching

Hi, I googled for the memory issue associated with UIImage and came across many threads talking about the problem but no real help or solution. I know when we use -imageNamed: the object is being cached so it's better to use initWithData:. When we use drawRect: and UIGraphicsGetImageFromCurrentImageContext(), does the image goes to cac...

I want to crop an image, draw a smaller size image without caching the images.... What is the best way or good code to get this done in iPhone?

Hello all, I am storing the images in database. I get the NSData and create an image from it. Now I want to crop or draw a smaller image of the existing image in database which I am getting from the querry. I dont want to cache the images since I am using them in bulk and want to release them as soon as the view being displayed where th...

Distributing iPhone Ad Hoc Updates

I am using ad hoc distribution to run a beta test program and have run into a couple issues with distributing app updates. The only way I have been able to get an app update on a device through ad hoc distribution is to delete the app from the device first and then install the update. This adds extra steps for beta testers and erases t...

Can I make a cell be in editing mode all the time?

I have a UITableView with one section. The last row it to add new objects, and it reads "Add Object". How can I make this cell stay in editing mode so that it will always show the plus icon? I've tried using cell.editing = YES and [cell setEditing:YES animated:NO] but neither makes the cell appear in editing mode. Thanks! ...

objC/C- combined: letting a C function wait till an objC-Delegate is finished

I'm having a problem here: I have a C function: int my_connect(int sockfd, const struct sockaddr *serv_addr, socklen_t addrlen) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; alertViewDelegate = [FirewallRest alloc]; [alertViewDelegate retain]; //ALog(@"1"); int error; //ALog(@"2"); char hostname[NI_MAXHOST...

How to respond to touch events in UIWindow?

Is it possible to handle touch events in the key UIWindow in the app Delegate or anywhere else? Any help would be appreciated please. ...

iPhone SDK: Hit-testing with PNG Alpha channels

I have a simple app which has a bunch of icons which should be dragged into a circle. Both the icons and circle will be PNGs with alpha channels. Could someone please help me with basic code to set the bounds of these objects to the non-alpha channel data? ...

Known iPhone OS bugs

Almost all of the time, if there's a bug, it's Your Fault™. But sometimes, it really is a bug in the API/OS. As iPhone OS is relatively new (especially 3.x) there are always a few bugs to look out for. I think it would be a good idea to compile them in a list. If you know of any, please list them, along with which versions are affected,...

Creating a nib file for a Table View Controller

I was trying to follow the Table View Programming Guide for iPhone OS but was having trouble creating a new Table View Controller that loads its data from a nib file. Specifically, I was trying to follow the steps in this part: If you prefer to load the table view managed by a custom table-view controller from a nib file, you mu...

How to fix: unrecognized selector sent to instance

I am having a problem that may be simple to fix, but not simple for me to debug. I simple have a button inside a view in IB; the file's owner is set to the view controller class I am using and when making the connections, everything seems fine, ie. the connector is finding the method I am trying to call etc. however, I am receiving this...

Picking video from PhotoLibrary with UIImagePickerController in OS 3.1

Hi, I am trying to pick a video from the photo library. In principle I know how to do it you set the mediaType of the image picker to an NSArray with kUTTypeMovie as its only object. But this doesn't seem to work on an iPhone 3G. Since OS 3.1 you can store videos you've received in your photo library. When you start the build in 'Photos...

UIToolbar UIBarButtonItem with both image and title has very dim text

My iPhone view adds some custom buttons to its toolbar. Each button has both an image and textual title, and is created like this: UIBarButtonItem *fooButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"foo.png"] style:UIBarButtonItemStylePlain target:self action:@selector(fooButtonPressed:)]; fooButton.title=@"Foo"; ...

Missing frameworks after upgrading to Xcode 3.2

I upgraded to Xcode 3.2 and now can't seem to add a number of frameworks, specifically the media player. A number of frameworks do not show up on the "Add Existing Frameworks Sheet". Per another question I tried setting the "Framework Search Path" to $(SDKROOT)/Library/System/Frameworks but that didn't seem to make any difference. ...

Why should I release (and therefore dealloc) objects just before application quit?

There are plenty of objects in each iPhone app witch will live forever till app dies. They are: application delegate, window, main view controller, may be navigation or tab controller, all the objects within them. Why on Earth should I release them just before quit spending precious CPU cycles? As far as I understand, apps process will b...

Cocoa-Touch: UIPickerView viewForRow crashing

I have a UIPickerView, in it's delegate I'm trying to customize the view for a row. I'm using the 3.1 SDK. So in the delegate I have: - (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view { // view.backgroundColor = [UIColor redColor]; return view...

Is there a way to tell if your app is being used while the user is on the phone?

There are certain portions of my app that would be better to highlight to the user if they're on the phone. Is there a call to check to see if we're on the phone? Unfortunately, "call" is a horrible word to check for in API documents for obvious reasons. ...

XIB Compiler Error

Getting a "Pattern colors are not supported by the iPhone SDK for iPhone OS versions prior to 3.0." error from Xcode when compiling an application for iPhone OS 2.2.1. I'm using Xcode 3.2 on Snow Leopard. The interesting thing is that others (I don't know host OS or Xcode version) are compiling this code fine. ...

How can I fix 'sticky' touchesMoved in my openGLES app?

I have my openGL scene rendering using the detach thread method //This is at the end of my init method SEL selector = @selector(preMainLoop); NSThread *thread = [[NSThread alloc] initWithTarget:self selector:selector object:nil]; [thread start]; [thread release]; } -(void) preMainLoop { while (isRunning) { NSAutoreleasePool *lo...

iPhone game programming: Framework for this game?

For something like this app http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=323242790&mt=8, what sort of game framework is needed? It's all 2D and I've read how popular Cocos is. The problem is I'm not a game programmer and there aren't any good Cocos tutorials out there. Would Cocos be able to create a game like...