objective-c

Working with the Objective-C/Cocoa flat namespace

I've not found anything that addresses my specific name space question as yet. I am working on some AudioUnit plug-ins featuring Cocoa based GUIs. The plug-ins use a common library of user interface classes (sliders, buttons etc) which are simply added to each Xcode project. When I recompile and distribute updates it is pretty much gu...

Objective C - Auto Fade Away Alert

I am trying to alert the user of something without being too intrusive. I love the way that Tweetie 2 handles connection errors and loading progress with their alert that automatically fades away after a second or two. Anyone know how is this done in objective c? It looks like this: http://dl.dropbox.com/u/38467/photo.jpg ...

How to compare two images with iphone sdk?

suppose i have taken one picture from my iphone camera and now i want to compare this image with other images and find best match image from that. is it possible or not? ...

UITableView: Highlighted cell after switching back views

Hi, I'm using a UINavController together with some UITableViews to display a kind of drill down for some data (e.g. like the Contact App). Works well. The only problem I have is, when I select a cell in the first table view it is highlighted, then the view switches to the next level and then, if I go back to the first level, the cell is...

Why is my view not resizing after rotating?

I'm only supporting the portrait orientation, but both the right-side-up and upside-down versions. Why do my subviews not resize appropriately? There's a status bar sized black space at the top of the view. If I change tabs and come back, it's corrected. ...

download part (one element) of a HTML page?

Is it possible to only download one part of a webpage, so like one element and its sub elements. If it is how would you do it in objective C? ...

Xcode Unit Testing - Accessing Resources from the application's bundle?

I'm running into an issue and I wanted to confirm that I'm doing things the correct way. I can test simple things with my SenTestingKit tests, and that works okay. I've set up a Unit Test Bundle and set it as a dependency on the main application target. It successfully runs all tests whenever I press cmd+B. Here's where I'm running i...

Resizing columns in NSOutlineView without showing headers

Hi, I've an outline view with two columns. I want to allow my users to resize both columns but it doesn't seem to be possible without also displaying the column headers. Anyone succeeded in doing this? ...

Using a proxy for NSURLConnection

Is there any way to get the content of a webfile (namely a .html Document) using a proxy, which is not defined in the system settings? I know that NSURLConnection is the right way to download a web file into a variable and not into a file (for which we should use NSURLDownload), but I don't find a way to use a proxy for it. Are there som...

POST and multiple submit buttons on form (iphone)

NSString *reqURL = [NSString stringWithFormat:@"%@/login",SERVER_URL]; NSMutableURLRequest *req = [[NSMutableURLRequest alloc]initWithURL:[NSURL URLWithString:reqURL]]; [req setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"content-type"]; NSData *myRequestData = [NSData dataWithBytes:[@"username=whate...

Autorelease vs. Release

Given the two scenarios, which code is best practice and why? Autorelease loginButton = [[[UIBarButtonItem alloc] initWithTitle:@"Login" style:UIBarButtonItemStylePlain target:self action:@s...

How to make UITextView look like Facebook login?

How can I make my textfields look like the Facebook login screen? ...

NSXMLParser 's delegate and memory leak

Hello, I am using a NSXMLParser class in my program and I assign a delegate to it. This delegate, though, gets retained by the setDelegate: method resulting to a minor, yet annoying :-), memory leak. I cannot release the delegate class after the setDelegate: because the program will crash. Here is my code: self.parserDelegate = [[Pars...

Does fast enumeration in Objective-C guarantee the order of iteration?

Can I expect it to go from the start of an array to the end in order? Can't find anything in the docs about this. i.e. is for (id val in array) { NSLog(@"%@", val); } always going to print out the same as for (int i = 0; i < [array count]; ++i) { NSLog(@"%@", [array objectAtIndex:i]); } ...

Performance considerations when mixing C++ and Objective-C in same file

I have some high-performance C++ that I need to interface with Objective-C, is there any performance penalty to just dumping this code into a .mm file that contains my Objective-C code vs. leaving this code in a separate .cpp file and extern-ing all the functions I need to call from the .mm file? ...

One off errors with NSLog and NSString stringWithFormat

Does anyone know why there would be one-off errors with NSLog and NSString? It works fine in 99% of my program, but for some reason this error appears in one of my model's description method: Example code: localFileId = 7; type = 2; localId = 5; NSLog(@"CachedFile localId=%d, 2=%d, localFileId=%d, type=%d, path=%@", localId, 2, localFil...

iPhone SDK: Switching to one view then back to previous view errors

I have a UITabBarConroller that I use to switch between 3 different views. This all works perfectly. On one of my tabs, I added a button at the to called "Add", I have added an outlet to this, as well as an IBAction method which looks like the following: // Method used to load up view where we can add a new ride - (IBAction)showAddNew...

iPhone loading xml file

what is the best way to load a xml file as an parsed object in objective c? ...

drawing parallel lines on iphone

how can i draw 2 parallel lines (1pixel in width) across the screen with 10px margin on each side? ...

(Not So) Silly Objective-C inheritance problem when using property - GCC Bug?

Update - Many people are insisting I need to declare an iVar for the property. Some are saying not so, as I am using Modern Runtime (64 bit). I can confirm that I have been successfully using @property without iVars for months now. Therefore, I think the 'correct' answer is an explanation as to why on 64bit I suddenly have to explicit...