objective-c

How to pass values by referance reference in objective C (iphone)

Hi Guys! I have a very basic question. I'm a new iPhone programmer. My question is can anybody tell me how can I pass values by reference to a function in obj. C? I know how to do it in VB and C#. But don't know how to do it in Obj c. Thanks ...

Converting enum into a class hierarchy

Let's say I am writing a class in Cocoa to act as a proxy to a server. To represent the current state of the connection, consider the enumeration: enum { MyConnectionStatusDisconnected = 0, MyConnectionStatusConnecting, MyConnectionStatusConnected, MyConnectionStatusCount }; typedef NSUInteger MyConnectionStatus; I may...

How do I release the ACTUAL memory and not just the pointer to the memory?

I am releasing things but the memory seems to still be there according to instruments. Am I just releasing the pointer and not the actual data? How do I release THE DATA in objective-c? What's the difference between [anObject release] or [&anObject release]???? Please excuse my lack of knowledge on the subject of memory and pointers. ...

Downloading images over the network is slow on the iPhone

I'm displaying a few images that are being downloaded over a network connection on a UITableView. Loading these images is extremely slow. Are there any performance tricks I can use? ...

tableview array

hi i am making an application of iphone, in which i hav one view name dealsviewcontroller, in this view i have table view in each row i am showing 3 arrays values. now the problem is that i have to shows these arrays values in next view in separate label. if anyone has any solution of this, it would be greatly apreciated. Thanx in advanc...

NSURLConnection leak?

i have set up a nsurl which grabs the data from http. when i run instrument, it says i have a leak NSFNetwork object. and how do i release theConnection in (void)ButtonClicked? or it will be release later on? - (void)ButtonClicked { NSURLRequest *theRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:KmlUrl] ...

Calculating columns with Core Data like SQL

Hey, I am sorting stores to get the closest stores. Furthermore I want to know how far away this shop is. The SQL query would look like this: select *, 6371 * 2 * ATAN2(SQRT(POWER(SIN((RADIANS(?) - RADIANS(latitude))/2),2) + COS(RADIANS(latitude)) * COS(RADIANS(?)) * POWER(SIN((RADIANS(?) - RADIANS(longitude))/2),2)), SQRT(1-POWER(SIN...

Anyone know how to slide in a UIDatePicker like keyboard?

Does anyone know how to slide in a UIDatePicker with a Done button like the keyboard control? If so, can you share some sample code on how. Thanks ...

@synthesize dataController was not called.

- (void)applicationDidFinishLaunching:(UIApplication *)application { // Create the data controller. DataController *controller = [[DataController alloc] init]; self.dataController = controller; [controller release]; rootViewController.dataController = dataController; // Override point for customization a...

Setter for NSString, how is it working?

This question follows on from a previous question, that has raised a further issue. What I am trying to understand is just when the pointers and object in this example are being created and what ultimately happens to them. I am still trying to get my head round this, so please excuse any false assumptions I may have made. // MAIN int ma...

How to navigate through textfields (Next / Done Buttons)

Hey all, how can i navigate through all my text fields with the "Next" Button on the iPhone Keyboard. The last text field should close the Keyboard. I setup in the IB the Buttons (Next / Done) but now im stuck. I implemented the textFieldShouldReturn action but now the Next and Done Buttons close the Keyboard. Thanks for your help! ...

Writing to files in bundle?

If you scroll down to the section 'Writing to Files and URLs' at this link, would the path varaible have to be a file on disk? Is it possible to write to a file in the bundle or must it always be deployed first? ...

Unloading ViewControllers from Apple's PageControl Example + UINavigationController's Relationship to its RootViewControllers

So I modified Apple's PageControl example to dynamically load various navigation controllers (along with their root view controllers) into the scroll view. I also added a technique that attempts to unload a navigation controller when it's no longer needed. I've only been at ObjC for a little over a month, so I'm not sure if I'm doing t...

NSFormCell for content other than text

I am building a dynamic form in a Cocoa application and am planning to use the NSForm object to add entries to it from an array. Some of the entries require a text input, but some require a boolean input (i.e. a dropdown list), and some even require a file input (i.e. a place to upload an image or a movie or sound file). It seems that ...

Initialize Objective-C string constants from plist

Hi, I have defined a constants class within my iphone program using the 'extern' and 'const' keywords as in the example described in: http://stackoverflow.com/questions/538996/constants-in-objective-c At this point, I am trying to initialize some string constants from the contents of a plist file, instead of being defined right in the...

Retaining value of variables over two ModalViewControllers

I am attempting to allow a user to select an image from the photo gallery and assign a comment to it. The photo class presents a UIIMagePickerController and I am able to successfully retain the image chosen by the user. However, when I create a view controller for the comment box and present/dismiss it, I am not sure how to save the va...

Managing data for UITableViews

I have two very simple, identical UITableViews in my app that are populated with thumbnail images named "thumb1.jpg", "thumb2.jpg", etc. These thumbnails have associated original images "1.jpg" and text files "1.txt" used for image processing. Everything is stored in the app's Documents folder. I want to keep the numbered, ordered namin...

Little confused on Delegates in Objective-C

I know a good bit of Objective-C and I'm working on a iPhone SDK book (coming from a Obj-C book that just did console programs). It attempted to explain delegates though it was rushed and didn't really understand what it was trying to convey. I'm a little confused on what they are and when you would use them. Basically it said they ar...

How to get a C method to accept UIImage parameter?

I am trying to do some Image processing on a UIImage using some EAGLView code from the GLImageProcessing sample from Apple. The sample code is configured to perform processing to a pre-installed image (Image.png). I am trying to modify the code so that it will accept a UIImage (or at least CGImage data) of my choice and process that inst...

How to sort a NSArray Alphabetically?

I have an array filled with [UIFont familyNames] but they aren't in alphabetical order. How do I do this? ...