Saving image to disk in HiDPI / Retina MacBook

2012-08-09 Thread Nala Gnirut
Hi all, in one of my apps I'm saving some images like this: *** NSImage *finalIcon = [[NSImage alloc] initWithSize:finalSize]; [finalIcon lockFocus]; // Some drawing on finalIcon here NSBitmapImageRep *imgRep = [[NSBitmapImageRep alloc] initWithFocusedViewRect:NSMakeRect(0, 0, finalSize.width,

Fine-tuning NSTextField auto completion

2011-10-04 Thread Nala Gnirut
Hi all, in my project I'm using NSControlTextEditingDelegate to auto complete what's typed in a NSTextField with search location suggestions retrieved from Google Maps API. "complete:" message is automatically sent to field editor by a NSTimer short after user ends typing. Now I'd like to fine-tun

Re: NSString localizedStringWithFormat: and thousand separators

2011-01-24 Thread Nala Gnirut
I'm getting the same results with NSString *test = [NSString localizedStringWithFormat:@"%'6.2f", 90.55]; NSLog(@"Test: %@", test); Output is: Test: '6.2f On Fri, Jan 21, 2011 at 5:58 PM, David Duncan wrote: > On Jan 21, 2011, at 3:

NSString localizedStringWithFormat: and thousand separators

2011-01-21 Thread Nala Gnirut
Hi all, according to Apple's documentation, localizedStringWithFormat supports format specifiers as detailed in IEEE printf specification . Unfortunately, a simple test does not seem to work as expected when using ' to request f

Programmatically add a UISearchBar

2009-10-30 Thread Nala Gnirut
Hi all, I'm trying to programmatically add UISearchBar to my UITableView header: - (void)viewWillAppear:(BOOL)animated { [...] if (!self.tableView.tableHeaderView) { // Add the search bar searchBar = [[UISearchBar alloc] i

Base64 encoding and deprecated stringWithCString: length:

2009-10-07 Thread Nala Gnirut
Hi all, I'm trying to use in a new Cocoa project base64 code sample from here: http://snipurl.com/sc6wd Part of the code adopts deprecated + (id)stringWithCString:(const char *)cString length:(NSUInteger)length so I'm replacing long base64Length = BIO_get_mem_data(mem, &base64Pointer); NSSt