uikit

How to create a custom locale with a custom NSDecimalSeparator value?

I'm having trouble with + (NSDecimalNumber *)decimalNumberWithString:(NSString *)numericString locale:(NSDictionary *)locale Because I want to provide very high precision values programmatically to have no floating-point errors initially, apple gives me the only option to rely on a wonky locale. So the documentation says pretty encr...

How would an NSScanner expect a string for scanning an NSDecimal?

In Brad's CorePlot I've seen this snippet, which eliminated the need for some coffee. I'm totally awake now: NSDecimal result; NSScanner *theScanner = [[NSScanner alloc] initWithString:stringRepresentation]; [theScanner scanDecimal:&result]; And Apple says: A scanner’s locale affects the way it interprets values from the string....

How to set an NSArray in NSUserDefaults?

I'm wondering why there is a -arrayForKey: method, but no -setArrayForKey: method. How could I set that array? ...

How to delete a user default value in NSUserDefaults?

I.e., my app sets some standard default values at the beginning. Then those values may get overridden by the user. And when the user messes things up, I want to set those settings back to my app default values. As I understand it, the app defaults are a different dictionary than the user defaults, and the user defaults just override thos...

How bad is it, in theory, if every class would include every other class?

Imagine an iPhone app with 30 classes. Every class has to interact with every other, so every class includes 29 other classes + foundation framework. I want to understand what's exactly happening when including a class. Does this duplicate the size in memory for that class in the app? Is it harmful to memory footprint and performance on...

How to make NSDateFormatter display locale-specific date?

I am using NSDateFormatter to set my date in my iPhone app, and dates are showing up properly. However, I am finding all the locales (my app supports up to 12 different languages) are sticking to the date format I specify via setDateFormat. Ideally, I want the date format to appear in a form natural to the region setting for the user, ...

How to read a NSDate in from a string?

I have strings with dates, and want to parse these into NSDate objects. Is there a way to do that? I've looked at NSDate and NSScanner, and haven't seen anything that would read it in from a string. ...

Is there a class or library for creating calendars?

I need a calendar in my app where the user can pick a date from. I wonder if there's a calendar library to do something like this? ...

Any way to BRIGHTEN a UIImage without using OpenGL ES?

Does anyone know of a way to simply and effectively brighten a UIImage by a specific amount? I am currently fiddling with the Apple Sample Code Example GLImageProcessing with poor results...My app currently does not use OpenGLES or EAGLViews and it is awkward trying to bridge the technology. ...

How to validate a given date in a specific calendar system from a string?

I have some dates represented as strings. These strings correspond to a date format of a particular locale and calendar system, i.e. Gregorian, Jewish, etc. In theory, I could try to use NSDateFormatter for this, but: 1) How does NSDateFormatter know in which calendar system the string date is expressed? 2) How does NSDateFormatter kno...

How can I iterate on RGBA of EACH pixel in a bitmap context?

How do I iterate on EACH PIXEL in a bitmap context? I found some source that seems to be attempting to do this but it is somehow flawed. Can someone tell me how to fix this code so that I can iterate on the RGBA of each pixel? -(UIImage*)modifyPixels:(UIImage*)originalImage { NSData* pixelData = (NSData*)CGDataProviderCopyData(CGImageG...

Is it possible to figure out the order of NSDateComponents objects for a specific locale and calendar system?

Example: An user has the US locale activated in the device and wants to enter a Jewish date. So the user uses the Jewish calendar system. As far as I get it, I can instantiate an NSCalendar with Jewish calendar system while still using the user's locale for the date+time format and other things. But how could I figure out the order of ...

How to read the useres preferred date+time format?

I need a representation of the current user's preferred date+time format, like for example: @"yyyy-MM-dd'T'HH:mm:ssZ" Or in other words: When I print out a NSDate nicely compatible to the preferred locale of the user, then I need that format in string representation as Unicode Standard symbols like in the example above. Is there a way t...

How to print out dates nicely, depending on thre user's locale and calendar?

Imagine a user with a French locale, who prefers an Islamic calendar. How could I print this date nicely as string in such a way, that it matches the user's locale, but where the date+time information matches also the calendar? I believe that both the locale and the calendar have effect on how to format a day. Not the locale alone. Mayb...

Is it possible to create an own calendar system in cocoa touch / UIKit?

There are some constants for NSLocale, like NSJapaneseCalendar, but what if I wanted to create a "Physical Calendar" or something that isn't there? Is there a way to define an arbitrary calendar system and then use that with NSDate, NSDateComponents and NSCalendar? ...

How to get a Unicode Standard (or other) string representation of the user's date+time format?

I can print out a date nicely based on the user's locale. But how could I get a string with the date+time format? ...

How to print all available information of a locale?

The locale object must contain more information than apple talks about in the documentation. i.e. it must contain several date format strings. How can I print all this stuff to see where they are? Is there a method that would print out all information about an object? ...

How to compute the order of NSDateComponents objects for a given date format?

I have an date format in a string, like this: @"M/d/yy h:mm a" Now I want to create text input fields for every component of that date, in the order of the given format above (which may vary depending on the locale. Are there methods or ways to analyze this date format in such a way that the order of the date format components can be...

Core Graphics has poor PIXEL iteration performance on iPhone?

I am trying to do an iteration on pixels to change the RGBA values of a UIImage without using OpenGL. I tried testing out iteration performance using the below code but was very displeased. It seemed like I could only get a few thousand iterations per second. And for a UIImage with several hundred thousand pixels, this would take way TOO...

How to get UIImage from EAGLView?

I am trying to get a UIImage from what is displayed in my EAGLView. Any suggestions on how to do this? ...