cocoa-touch

UIInterfaceOrientationLandscapeLeft and UIInterfaceOrientationLandscapeRight are reversed?

The documentation says: UIInterfaceOrientationLandscapeLeft The device is in landscape mode, with the device held upright and the home button on the right side. UIInterfaceOrientationLandscapeRight The device is in landscape mode, with the device held upright and the home button on the left side. However, I'm getting...

Changing Compiler to llvm-clang on existing iPhone Project

When I switch the Compiler Version to Clang llvm 1.0 in existing projects I get the following build error when Precompiling the *.pch file: error: can't exec '/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc-4.2' (No such file or directory) Is there another setting I need to change to get my project to work with the n...

How can I split a string without separator?

I need to split string without a separator. Here is the code.. myarray = [mystring componentsSeparatedByString:@","]; Here I used separator "," to split string, but I want to split without using a separator NSString *mystring =@"123456"; I have this value , now I want to insert that value in an array like this: array[0]=1; array[...

Set a relationship with Core Data

I have two entities that are connected through a one-to-many relationship, let's say CategoryEntity and ItemEntity. The relationship is optional for CategoryEntity (there can be categories without items), but required for every ItemEntity. At the app's loading, the Categories already exist in the store, and I want to import ItemEntities ...

Cell ID info on iPhone

Is it possible to get Cell ID information on iPhone SDK 3.0? ...

Creating multiple NSURLConnections. How to identify which Async call

I am intending to create 2 requests using NSURLConnection. When the server responds and calls connectionDidFinishLoading it passes in the connection as the parameter, but how do I identify which connection is passed in? ...

NSMutableURLRequest and a Password with special Characters won't work

I'm writing a small program (using Cocoa Touch), which communicates with a webservice. The code for calling the webservice, is the following: - (IBAction)send:(id)sender { if ([number.text length] > 0) { [[UIApplication sharedApplication] beginIgnoringInteractionEvents]; [activityIndicator startAnimating]; NSStr...

iPhone Camera and Image Chooser

Hi Everyone: I have found a lot of information on using UIImagePickerController to let the user choose the image they want from the Photos application's data. I am wondering how I can create this same effect on 3.0, as it doesn't seem as if a lot of the old code works anymore. In addition, I would like the user to be able to take a ne...

NSMutableURLRequest and SpecialCharacters in XML (HTTPBody)

Hello, in my App I have to consume a RPC Webservice. For tht I have to send a XML as the HTTPBody of the NSMutableURLRequest. It works fine as long as i don´t use Special Characters inside the XML. NSString* pStr = [[NSString alloc] initWithFormat:@"<?xml version=\"1.0\" encoding=\"UTF-8\"?><methodCall><methodName>samurai.SessionIniti...

Does iPhone support adding custom properties to Address Book records?

Hi, Does anyone know if iPhone (i.e. Cocoa Touch) lets you create custom properties? I've used it with the mac before (where it works beautifully) and would like to use this technology for an iPhone app that syncs with an app on the mac through the Address Book (using MobileMe). If I can't use custom properties, however, I'll have to a...

dismiss ModalViewController from another viewcontroller in iPhone

Hi The new 3.1 sdk allows for the UIImagepickerController to hide the camera controls and use your own controls via cameraOverlay view. So, I implemented the overlay view through another Viewcontroller: CameraViewController *cameraController = [[CameraViewController alloc] initWithNibName:@"CameraViewController" bundle:nil]; self.camer...

Using cocoa how do I get SAX to distinguish endElements in XML when they are the same ?

From the XML below I'm trying to retrieve the second element in the sequence. Notice the end node is the same as the start in each entry, this is making its retrieval a bit tricky. I've tried setting a for loop at the startElementSAX function to evaluate and pick-up the Width="60" attribute. Although this will sort the data correctly i...

Is "English" or "en" the preferred .lproj folder name now?

In Apple's documentation and example code, I see lproj folders both named with the name of the language, such as "English", and with an ISO 639 code, such as "en". What is the definitive naming requirement? I have not been able to find it. If there isn't one, what are the advantages and disadvantages of each type of name? ...

How to send message from iphone/touch to server(tomcat) ?

Hi, I have native iphone/ipod touch application.After enter the infomation on that application it will store into server database,again send message to iphone/ipod.Using objective c how to do ? Please help me out... ...

NSMutableArray passing by parameter memory leak

Hi guys, I'm experiencing a hard issue here, would appreciate any, I mean ANY help =) I'm a experienced developer by I'm new to Objective-C/iPhone/Cocoa. I wanna create a class controller which I'm able to pass a NSMutableArray as a parameter. Then, we have: selTimeIntController = [[SingleSelectPickerViewController alloc] initWithSet...

How do I set the firstresponder?

I have a view built through IB, there's a text view and and button on it. When the view shows up I would like to have the keyboard to be already displayed. I tried to set the first responder in the didViewLoad but that didn't work. I do have an IBOutlet that is connected to the textView and related accessor. ...

Sorting an array of doubles or CLLocationDistance values on the iPhone

I'm trying to sort a list of CLLocationDistance values by closest distance (ascending order). I first converted the values to NSString objects so that I could use the following sort: NSArray *sortedArray; sortedArray = [distances sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)]; NSString cannot sort on the numeric value. ...

function example for sortedArrayUsingFunction in Cocoa

I'm trying to create a compare function like the example on the apple site: http://developer.apple.com/mac/library/documentation/Cocoa/Reference/Foundation/Classes/NSArray%5FClass/NSArray.html#//apple%5Fref/occ/instm/NSArray/sortedArrayUsingFunction%3Acontext%3A The example is not objective-c. Does anyone know how I can convert the ex...

How to jump to a specific view?

I have 3 views (xib'd) the third view opens a modal view (also xib'd). My goal is to dispose the modal view and jump on the view #1. I used the following code but it does nothing. self.statusView = [[StatusViewController alloc] initWithNibName:@"StatusViewController" bundle:nil]; [self.navigationController popToViewController:self.stat...

How to add a custom iPhone UI element that is not an IB component?

I'm trying to create an application that uses the iPhone MapView (under Google Code). I can't figure out how to integrate this thing into my application without handwriting the entire UI, ie not using the IB at all. How can I use the Interface builder to create all of my menus and such but add the MapView in? Do I need to edit the MapVi...