iphone

How do you get an iPhone's device name

If you open Settings -> General -> About, it'll say "Bob's iPhone" at the top of the screen. How do you programmatically grab that name? ...

Push a UIViewController onto UINavigationController from a UIView?

Typically, my event handling occurs in the UIViewController, so i used the following line of code: [self.navigationController pushViewController:viewController animated:YES]; However, now my event handler is in the UIView. specifically, i'm using - (void) touchesEnded:(NSSet*)touches withEvent:(UIEvent*)event So from inside my touchesE...

Real-time Pitch Shifting on the iPhone

I have a children's iPhone application that I am writing and I need to be able to shift the pitch of a sound sample using Core Audio. Does anyone have any example code I could look at where this is done. There are many music and game apps in the app store that do this so I know I am not the first one. However, I cannot find any examples ...

How do I show the standard spin animation during a CoreLocation lookup on iPhone?

I don't want to just use a UIActivityIndicatorView -- I want the spinning animation that you see in the Maps application while you are doing a CoreLocation lookup. Do I have to create my own animation, or is there an easy way? edit: I'm referring to the standard Apple "Maps" application. Specifically I'm referring to the animation th...

Xcode 3.1.3 - Organizer The device is not activated. Please activate it using iTunes

Hello, I recently upgraded my XCode SDK to version 3.1.3 and my iphone OS to 3.0. It is important to note that everything was working fine when i had os version 2.2.1 in my iPhone. My iPhone Touch device is not jailbroken and I have a valid provisioning profile in the organizer which is linked to my iPhone Touch however it has a yellow ...

How can you have a Tab Bar Controller and a Table View?

I am trying to make it so that on one of the tabs there is a table view Any ideas? Thanks ...

Ignore touches to background (super) view

How should I be handling, or rather NOT handling (ignoring), touches to my background view? It happens to be the view of my View Controller which has subviews (objects) that I DO want to respond to touch events. Setting userInteractionEnabled = NO for the view seems to turn off ALL interaction for the subviews as well. I'm currently te...

iPhone OpenGL ES incorrect alpha blending

I have a problem with incorrect alpha blending results with openGL ES on iPhone. This is my code for creating texture object: glGenTextures(1, &tex_name); glBindTexture(GL_TEXTURE_2D, tex_name); glTextImage2D(GL_TEXTURE_2D, 0, GL_RGBA, tex_width, tex_height, GL_RGBA, GL_UNSIGNED_BYTE, tex_data); 'tex_data' is loaded from raw RGBA8888...

UIImage from bytes held in NSString

Hi all, I am trying to create a UIImage from a byte array that is actually held within a NSString. Can someone please tell me how I can do that? Here is what I was thinking of doing: NSString *sourceString = @"mYActualBytesAREinHERe="; //get the bytes const char *bytesArray = [sourceString cStringUsingEncoding:NSASCIIStringEncoding];...

Is there a more concise way to concatenate these strings in Cocoa?

NSString *latitude = [[NSString alloc] initWithFormat:@"%g°", coordinate.latitude]; NSString *longitude = [[NSString alloc] initWithFormat:@"%g°", coordinate.longitude]; self.pointLabel.text = [latitude stringByAppendingString:@", "]; self.pointLabel.text = [self.pointLabel.text stringByAppendingString:longitude]; ...

Converting a CGLayer to a *transparent* UIImage and PNG file in CoreGraphics iphone

Hi all, I've been making a simple painting app for the iphone. I'm trying to convert the drawn image to a transparent PNG (I don't want a white background). I'd also like to get a UIImage representation to use in a UIImageView. Currently, I respond to touch events and draw paths to a CGLayer which is then drawn to my views context. I h...

Using MPMediaPlaylistPropertyPlaylistAttributes and bitwise operators on NSInteger- Objective C (iPhone)

Hello, and thanks in advance for you time. I am trying to filter out certain types of playlists for an iphone app (genius and On-the-go, specifically). the documentation says that the property attribute MPMediaPlaylistPropertyPlaylistAttributes will return the attributes associated with a playlist in the form of an NSNumber containing a...

Customizing UISlider appearance

I want to set the thumb image of a slider for a normal state, but still use the default track images. So i do this: [theSlider setThumbImage:[UIImage imageNamed:@"my_thumb.png"] forState: UIControlStateNormal]; and I get my image appear as thumb, but then default track images disappear. Can't you just customize the thumb image and ...

Using NSDateFormatter on the iPhone, protect locale but lose date components.

Hi This is a slightly tricky question. I am using NSDateFormatter on the iPhone but I wanted to only show a standard date without the years component. But retain the users locale formatting for their date. I could easily override the formatting using [dateFormatter setDateFormat:@"h:mma EEEE MMMM d"]; // hurl.ws/43p9 (date formattin...

unable to read unknown load command 0x80000022

Hello, In my app, I use a very large amount of code that I copied from Apple's SpeakHere example, and when I run the app on an iPhone device it spits out this error about a hundred times before loading the XIB: unable to read unknown load command 0x80000022 It also prints these errors: warning: Unable to read symbols for ""/Users/ea...

Magnifying class problem

I am added uitextfield into uitableviewcell using this code textField=[[[UITextField alloc]initWithFrame:CGRectMake(5, 10, 290, 70)]autorelease]; textField.delegate=self; textField.keyboardType=UIKeyboardTypeURL; textField.autocorrectionType=YES; textField.textColor=[UIColor blackColor]; textField.placehold...

Interface Builder UIDatePicker

is there a way to set the UIDatepicker to minute and seconds versus Hour and Minute edit I ended up adding my own UIPicker class, and creating the value and label myself. ...

Does a NSURLConnection retain its delegate?

Summary of my question: Does NSURLConnection retain its delegate? Detailed question and scenario: I have a custom class, called JsonDownloader that is takes in a URL and returns an NSDictionary of the JSON that the URL returns. On an iPhone app, I do something like this. (the init method kicks off the whole process) (void)viewDidLo...

What does "error: redefinition" mean? and how do i fix it?

I got this error twice. it says "error: redefinition of '-[SampleTableViewController tableView:cellForRowAtIndexPath:]'" ...

How can I disable the touch detection???

How can I disable the touch detection within the action that running, because I don't want the character flying in the sky like a superman if the player clicking and clicking within the action, the character will never land if they keep clicking. I found the method "isDone", is that relate to this method?? player click -> action(cannot c...