cocoa-touch

Changing color of the titlebar, background and text of MFMailComposeViewController

I am sending email from my iPhone application. Everything working fine, but I want to change the color of the title bar that appears from blue to black and the background color from white to black. Also, all the text to white color. What should I do? Anyone please help! I used the below code: - (IBAction)sendMail{ MFMailCompose...

NSPredicate by NSManagedObject for many-to-one lookups

Hi guys, I've got the scenario with two NSManagedObjects, Arm and Person. Between them is a many-to-one relationship Person.arms and inverse Arm.owner. I'd like to write a simple NSPredicate where I've got the NSManagedObject *arm and I'd like to fetch the NSManagedObject *person that this arm belongs to. I could make a textual repres...

Lazy load pages in UIScrollView

I have a UIScrollView that contains large images and am using paging to scroll between images. In order to save memory, I am loading only one image before and after the currently visible one and loading/releasing new images after a scroll has completed. The problem occurs when one scrolls quickly and scrollViewDidEndDecelerating is not ...

How to open multiple images and be able to drag them in Cocoa

Hello, I'm trying to make a board like that you can import as many pictures as you like to that board. How can I do that? handle multiple images? The other question is how to recognize a drag movement and move the image to the Cursor position? Thanks!! (Mac SDK) ...

Converting NSDecimalNumber to NSString

I'm retrieving a key from an object that looks like this: po obj { TypeID = 3; TypeName = Asset; } The key value is being retrieved like this: NSString *typeId = (NSString*)[obj objectForKey:@"TypeID"]; Rather than typeId being an NSString, it is an NSDecimalNumber. Why is that? How do I convert it to an NSString? ...

Persisting a single UISearchBar instance across 4 separate UITableViews

Hi fellas, I'm in the midst of an iPhone app that needs to have 4 separate UITableView objects sharing access to one UISearchBar in the first section and first row of the aforementioned UITableView objects. I have tried to offset the UITableView's frame by 44 pixels, then adding the search bar as a subview of my UIViewController's view...

How can I use this animation code?

I'm a newbie and I need some help. I want to display a popup image over a given UIView, but I would like it to behave like the UIAlertView or like the Facebook Connect for iPhone modal popup window, in that it has a bouncy, rubbber-band-like animation to it. I found some code on the net from someone who was trying to do something simil...

How to hide a tabbar at the app startup?

So, I want my app starts with a UIViewController(without seeing a tabbar), and then enter a UITableView with navigationbar and tabbar. the problem is that the Tabbar is visible at the app starts up, anyone can help on this will be very appreciated... ...

[iphone] UIControlEventTouchDragEnter doesn't seem to work for catching a tap that slides into a control

I wanted to allow for a method to get called, if a finger was dragged from outside into the bounds of a control. I thought UIControlEventTouchDragEnter would do it, but it doesn't seem to. Does anyone know if there is a way to trigger an action based on a tap sliding into a control? This is what I was trying, but got no calls to my -f...

Stream multiple files in _one_ ASIHTTPRequest

What is best practice to stream multiple files in one ASIHTTPRequest? Right now, for one file I use: .... ASIHTTPRequest *request = [[ASIHTTPRequest alloc] initWithURL:someUrl]; [request setShouldStreamPostDataFromDisk:YES]; [request appendPostDataFromFile:someFilePath]; [request startSynchronous]; How to stream multiple files withou...

Decode received multipart/form-data request in Cocoa

Hi: I wonder if there is any possibility to explicitly decode an incoming multipart/form-data POST request. Is there any lib to handle this safely? Several files are embedded in this request and I want to save these files individually. NSData *data = [(id)CFHTTPMessageCopyBody(request) autorelease]; Content-Type: multipart/form-data; bo...

NSNumberFormatter weirdness with NSNumberFormatterPercentStyle

Hi, I need to parse some text in a UITextField and turn it into a percentage. Ideally, I'd like the user to either type something like 12 or 12% into the text field and have that be parsed into a number as a percentage. Here's what's weird. The number formatter seems to not like 12 and seems to divide 12% by 10000 instead of 100: NSN...

Add a line below the navigationBar title

How can I add a second line (smaller font) below the navigationBar title as shown below? I want to show it below Sunday ...

Is there an API to tap to Apple's Bonjour service?

Is there an API to tap to Apple's Bonjour service (I'm planning to share my non iTunes library with iPad)? ...

NSDecimalNumber multiplication strangeness

ExclusivePrice, quantity are both NSDecimalNumbers. NSDecimalNumber *price = [exclusivePrice decimalNumberByMultiplyingBy:quantity]; NSLog(@"%@ * %@ = %@", exclusivePrice, quantity, price); The result I get: 2010-04-05 00:22:29.111 TestApp[13269:207] 65 * 2 = -0.00000000000000000000000000000000000000000000000000000000000000000000000...

What class should manage/control the CALayers in my view using proper MVC?

I have a ViewController with a view (UIView). I need to handle touches, run some logic, check against model data, and and add and remove sublayers to the view based on those touches. Then I need to update the model based on the results. Should I have: ViewController - manage touches, get/set model data, add/remove sublayers UIView ...

iPhone: Disable the "double-tap spacebar for ." shortcut?

By default, if you tap the spacebar twice on the iPhone or iPad, instead of getting "  " (two spaces), you get ". " (a period followed by a space). Is there any way to disable this shortcut in code? Update: Disabling autocorrection via UITextInputTraits doesn't work. Update 2: Got it! See my post below. ...

Changing font size of tabbaritem

Is it possible to change the font size of tabs? ...

How do I call create a name of a button variable in a code, with a number in it?

I've got a int, that is changed in a previous method, that now has to be part of the name of a button variable. For example: int numberFromLastOne; numberFromLastOne = 4; I then want to get 'button4' to do something. Could I use something like this? [[button@"%d", numberFromLastOne] doSomething:withSomethingElse]; I've never had t...

capture image tag from multiple images

Hello, I have a .xib file containing 30 images and each image has a unique tag. How could I capture this tag in order to know which image has been touched when (void)touchesEnded??? How to define that images, on an array? Thanks for any idea to solve it!! ...