cocoa-touch

Iphone App - Is it possible to use text from an app?

Hey, I am about to start working on an app. I am a beginner, so I am starting out with a pretty basic concept. But, I was wondering if it was possible to send texts from an app. For example, if the person using my app sets a new high score, could they hit a publish button and my app could then send a text to his buddy bragging about the ...

How to access the Overlay object boundingMapRect at the OverlayView?

Hi All, I'm trying to place images on top of Google Maps and I'm having trouble to fetch the overlay's boundingMapRect. The odd thing is that when I check the 'overlay' with the debugger the correct data is there, but when I try to print it - its garbage. This is the printing code: MKMapRect overlayRect = [self.overlay boundingMap...

loading resources dynamically for iphone 3GS and 4

Since the display resolution is different, I wonder if there is an official guide or tutorial that shows how to load images. icons, nibs, etc. dynamically for iPhone 4 and iPhone 3GS. Thanks in advance. ...

Memory warning removes UINavigationBar buttons

I've overridden drawLayer:inContext: on UINavigationBar in a category so that I can put a custom image up there. I hate it, but my client was adamant. As a result, I've had to fall back to some pretty ugly hacks to get things up there. I had to put a new method in that category to put a title on the nav bar header, and I have to call it...

How can I detect a touch entering the frame of a UIButton?

Hi, I'm writing a class that implements a piano keyboard. Right now it's just a UIView and each key is a UIButton. I'd like the user to be able to drag their finger and hit several keys, but right now it only registers touch down. I've added UIControlEventTouchDragEnter as a way to trigger the key event but it only works if you hit a ke...

Unable to trust a self signed certificate on iphone.

I am currently trying to connect to a server with a self signed certificate. I am using NSURLConnection to connect to the server. How can I make sure that I only trust the right server and cancel all other connections? I am using the following code - (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(...

showsUserLocation does not display blue dot in iPhone 4.0

So, I've created a CLLocationManager, called it to start updating, set mapView.showsUserLocation to YES, and returned nil for the userLocation annotation. Here are some snippets from my code in my UIMapViewController: - (void)viewDidLoad { CLLocationManager *locationManager = [[CLLocationManager alloc] init]; [locationManager...

need help with memory management

so i have a program i am developing and as im fairly new to objective-c and cocoa touch im not very familiar with the concepts of memory management in ipad app development. my problem is that my program keeps crashing without any warning and without telling me why, i turned on breakpoints and it shows an exc_bad_access signal. which lead...

Can you help me understand what Cocoa is?

I have spent a lot of time getting into iOS development. I have spent a lot of time familiarizing myself with objective-c as well as xcode. I have spent a lot of time going through the motions without understanding the fundamentals of what Cocoa is. I haven't grown up my entire life understanding coding concepts as some people have, and...

How can I map a list of ranges to a single value?

I've only recently jumped into the world of iphone development and objective-c, so I'm still a bit lost as to how I might implement something like this. I have a float, and I have a list of ranges that float can fall within and the corresponding value I should return, eg: 10.0 - 14.5 : 1.0 14.5 - 17.0 : 2.0 17.0 - 23.0 : 2.5 23.0 - 32....

[iPhone] image width and height was exchanged after load to CALayer

I want to put an image into a CALayer's sublayer, like this: CALayer *parent = [CALayer layer]; CALayer *child = [CALayer layer]; [parent addSublayer:child]; UIImage *image = [UIImage imageWithContentsOfFile:imagePaht]; NSLog(@"%f-%f", image.size.width, image.size.height); child.contents = [image CGImage]; I have five images in my ...

How to convert images to video on iPhone?

I'm looking for a way to convert a sequence of images to a video. And I also want to add sounds to specific time within the video. How can I do that on iPhone? Is there a library that helps? ...

UIImagePNGRepresentation issues?

I want to load images from UIImagePickerController, then save the selected photo to my app's document directory. UIImage *image = [info objectForKey:UIImagePickerControllerOriginalImage]; NSData *data1 = UIImagePNGRepresentation(image); NSString *fileName = "1.png"; NSString *path = //get Document path, then add fileName BOOL succ = [d...

Unable to access data in one class from another class

Here is the class which gives me a modal view of the camera @interface ViewController : UIViewController <UIImagePickerControllerDelegate> { UIImagePickerController *cameraView; // camera modal view BOOL isCameraLoaded; } @property (nonatomic, retain) UIImagePickerController *cameraView; - (IBAction)cameraViewbuttonPressed; - (voi...

problem in reading files in iphone application!

I am reading a file in iphone app. Its Works Fine. NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSLog(@"%@",documentsDirectory); NSString *fileName = [NSString stringWithFormat:@"%@/test.txt",documentsDirectory]; ...

How to change localization after an iPad app has been started

Hello, i am currently working on an iPad app (iOS SDK v3.2). The app is localized in several languages, i.e. english, german, russian, ... I want the user to be able to switch the localization for some UI elements after the app has been started. What is the best way to achieve this? NSLocalizedString always chooses the locale defined i...

ModalViewController rotation issues within TabBarController

Hi all, I cant quite see why Im having this issue but I am..... Basically I have a Tabr bar controller with a navigationController in one of the tabs. In this particular tab I want the user to be able to rotate the device and see a completely different view, not the original view rotated! In order to achieve this (at full screen) I have...

Keyboard won't dismiss when popover closes on iOS 3.2

- (BOOL)popoverControllerShouldDismissPopover:(UIPopoverController *)popoverController { [self dismissFirstResponder]; return YES; } -(void)dismissFirstResponder { [nameField resignFirstResponder]; [descriptionField resignFirstResponder]; [helpField resignFirstResponder]; } I have tried loads of different things,...

Updating UI Manually

Hi, Is there a way to update UI manually? For example, I have a function which updates UI and execute some logic. After the UI update, it will execute some logic that will take a long time and update of UI has to be wait until the execution of logic is finished. Is there a way to update UI manually befor even the logic is even executed?...

Dynamically loading NIBs?

Rather than having three separate controllers and their associated *.xib files I am trying to setup a generic controller and then instantiate it with one of three different xib files RED.xib" "GREEN.xib" & "BLUE.xib" NSString *nibColor; switch (selectedRow) { case 0: nibColor = @"RED"; break; case 1: nib...