iphone

removeObserver with NSNotification... what am I doing wrong?

Basically, I have a view1 which at some point, calls view2 (via presentModalViewController:animated:). When a certain button in view2 is pressed, view2 is calls a notification method in view1 and immediately afterward is dismissed. The notification method pops up an alert. The notification method works fine and is called appropriately. ...

button click crashes

I have below code in a IBAction linked to a UIButton to change the background image on Button Click. UIImage *imageGreen=[UIImage imageNamed:@"bgGreen.png"]; [clickButton setBackgroundImage:imageGreen forState:UIControlStateNormal]; [imageGreen release]; after clicking the button three times it crashes the app in iPhone Simulato...

Global NSMutable array of a project

Hi, I want to know how i can declare and use a global NSMutable array of an Objective C project. I mean i need to update the here in one class and need to use in another class.... can anyone give me any kind of idea?? Thanks Rony ...

New NSString substringWithRange: Error Message

I'm getting an interesting new error with iOS 4: -[NSCFString substringWithRange:]: Invalid range {11, 4294967295}; this will become an exception for apps linked on SnowLeopard. Warning shown once per app execution. The error is caused by a snippet of code I got from a blog post that helps Title Case a string, and it's not going to be ...

Chipmunk: How to remove shape and body?

First, sorry for my English, im not an American. My question is how can I remove the shape and body from the space, this isn't related with collision detection. Im triying to do this with a touch event, specifically I'm trying to clear a ball Touching it (I have a lot of balls in the space), but I have no idea how to do it, I have been l...

How do I start auto recording a video in iPhone Sdk

Hi I am working on a application which requires the recroding action for the camera of the iPhone 3GS to start recording a video directly.. Earlier I have done this screwing up the UIImagePicker and using CGGraphicContext to get images but that was for a single image. Is there a possibility of triggering the vedio recording directly. W...

XML parser for iphone

what's the best XML parser for parsing RSS feed type documents on the iPhone? Ive found a few samples on the internet but kept running into memory leak problems. any suggestions? ...

Make a function to connect in objective c

This is my code: NSError *error; NSURLResponse *response; NSData *dataReply; NSString *stringReply; NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL: [NSURL URLWithString: URLGOESHERE]]; [request setHTTPMethod: @"GET"]; dataReply = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:...

iphone sdk: Is it possible to play audio playlist in the background in iOS 4

I tried to implement this. My original post is here http://stackoverflow.com/questions/3297571/iphone-playing-audio-playlist-in-the-background So after some testing I begin to doubt whether it's even possible. does anyone know whether it's possible to use AVAudioPlayer to play multiple tracks in the background? I myself haven't found a...

show image on and off for iphone

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {NSLog(@" TOUCH "); UITouch *touch = [touches anyObject]; CGPoint p = [touch locationInView:self.view]; if ([[touch view] tag] == 1000 ) { // 2 images are Poped here (ony by code /// this is a png { ...

UITextField turn places with UILabel in the UITableView during scrolling

I have a strange problem with UITableView and UITextField inside the cell (as subview). In the window view (UITableView, grouped, scrollable) there are two sections. First section has got 5 rows: 1.1 - cell with UITextField 1.2 - cell with UILabel 1.3 - cell 1.4 - cell with UITextField 1.5 - cell with UISwitchButton and the second ...

How can I pass two value to a NSThread object from the main thread OR have the same value in both threads?

I have a function which executes as a different thread, thread named imageThread. But when the device rotates, the control automatically returns to the main thread and after their execution its given back to the imageThread. That's how i wanted it to function. But the problem is I am using some global variables, whose value changes in th...

Trying to create a rectangle filled with blue UIImage object.

Hi, I want to create a blue rectangle image and see it in my view, but this code doesn't seem to work: CGRect imageRect = CGRectMake(50, 50, 64, 40); UIGraphicsBeginImageContext(imageRect.size); [[UIColor blueColor] set]; UIRectFill(imageRect); UIImage *aImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndIma...

In-app purchase for OVI like iPhone

Is there something like "in-app purchase" feature of iPhone for OVI store developers? ...

Localizing app icons in iOS 4

Ok, this one is driving me crazy... I've had my app icon localized using InfoPlist.strings with language-specific CFBundleIconFile values (selecting different icon for each of the supported languages). Since iOS 4 this method no longer works, and I'm struggling to find one that does. Apple docs state that it should be enough to put co...

iPhone Camera Subview

When calling the camera, what is the subview layer? I am trying to bring the camera view and its controls to the top of the views....because I am still trying to solve the UIToolbar at the bottom of my view hiding the camera controls. Any other suggestions or code would be appreciated. ...

Playing multiple vibrates on iPhone

How can I play two or three vibrates in a row? Or different patterns of vibrate? Repeating AudioServicesPlaySystemSound(kSystemSoundID_Vibrate) does not work. Only does a single vibrate. Tried using callback OSStatus AudioServicesAddSystemSoundCompletion ( SystemSoundID ...

How to start Audio file from certain location using AudioQueue?

Hi All, I have analyzed "SpeakHere" sample code of iPhone dev forum. There is a code for starting AudioQueue as following.. AudioTimeStamp ats = {0}; AudioQueueStart(mQueue, &ats); But I have no idea that how to start middle of file. I changed AudioTimeStamp with various values include negative. But it does not works. Please let m...

How to add a label to a plot

I have core-plot graph like this: How can I add a label to each of these plots. I have seen some references about adding a CPTextLayer to the graph, but could not figure it out how to do it. Is there an example somebody can point me to? ...

Add an instance of NSManagedObject to NSManagedObjectContext ok, updating the same instance failed

I am using core data in my iPhone app. I have created a simple class Friend, which derives from NSManagedObject and which uses the following property: @property (nonatomic, retain) NSString *name; I am able to add and delete instances of this class to my context and my changes are persistent also. Now I want to update/modify a Friend-...