cocoa-touch

UISearchBar cancel button color?

When I drop a UISearchBar into my view inside Interface Builder, and change its style to Black Opaque, the cancel button stays unfittingly blue / gray and doesn't become black. How can I make the cancel button black? EDIT: It does work like this: // Assume a UISearchBar searchBar. NSArray *subviews = [searchBar subviews]; // The inde...

Safe way of iterating over an array or dictionary and deleting entries?

I've heard that it is a bad idea to do something like this. But I am sure there is some rule of thumb which can help to get that right. When I iterate over an NSMutableDictionary or NSMutableArray often I need to get rid of entries. Typical case: You iterate over it, and compare the entry against something. Sometimes the result is "don'...

ceilf and floorf equivalent methods for NSDecimalNumber

Are there equivalent methods for ceilf and floorf for the NSDecimalNumber type? I couldn't seem to find any. ...

UITableView setting standalone delegate object?

I have setup a sample application using a UITableView. Initially I did this by conforming my controller to <UITableViewDelegate> and <UITableViewDataSource>, added a tableView in IB and connected "datasource" & "delegate" to Files Owner. It all works so thats good. What I have been trying out is creating my own class for the delegate. I...

How can I check the content of the arrays? Parsing XML file with ObjectiveC

I have 3 classes-> video { nameVideo, id, description, user... } topic {nameTopic, topicID, NSMutableArray videos; } category {nameCategory, categoryID, NSMUtableArray topics} And then in my app delegate I defined-> NSMutableArray categories; I parse an XML file with this code. I try the arrays hierachy, and i think that i d...

UISegmentedControl parts collapse to 0 width

Anyone had a smiliar bug? The control is placed from Interface Builder and not modified in any way by code. It was working fine until some time ago after a random build the bug appeared. Happens in two places in my app while the same exact kind of setup is fine inside another viewcontroller. In all cases the controls are inside a UINav...

Setting up an independent delegate?

Its common for the dataSource and delegate to be the same object, its also common for this object to be the viewController. In all the info/tutorials that I have seen online delegates are always setup as above. If I wanted to create my own class instead can anyone give me any pointers as to how I might do that. Where does that...

"Infinite Drill-down" with UINavigationController

Can anyone suggest an article or perhaps an example of how to create an "infinite drill-down" with UINavigationController like you see in the Facebook, IMDB and BrightKite apps? ...

uitableview to fake a multifont uitextview

has anyone used a uitableview to write a uitextview-like interface where I would be able to use multiple fonts? How would I arrange the table and responder? I need to have a editable view which deals with raw text (the font info would be stored elsewhere). UIWebView doesn't cut it because of both reasons. ...

PhoneGap iPad lauch screen does not fit

Hi, I created an App which is compatible to iPhone and iPad. Because it is based on HTML (PhoneGap) the App itself is the same for both devices (HTML scales well!). But the launch screen image does not fill out the display on the iPad upon launch. In my Resorces folder there is only the iPhone launch image which is to small for the iPa...

How can I break from a method prematurely that's being called by NSTimer

Basically I'm writing a metronome app, but I'm using a sound file that, depending on the BPM, might not be finished playing when the "play" method is called again. For example, if the sound file is 0.5 seconds long, but the BPM is 200, the "play" method needs to be called every 0.3 seconds. I'm not overly familiar with NSTimer, but it a...

UITextView insert text in the textview text

I want to have to occasionally insert text into the UITextView text object. For example, if the user presses the "New Paragraph" button I would like to insert a double newline instead of just the standard single newline. How can I go about such? Do i have to read the string from UITextView, mutate it, and write it back? Then how would ...

Add a sub-view to a DetailView UIView in iPad

I'm creating a split view controller app, the detail view has a segmented control in a navigation bar at the top. Clicking on a segment will add a new view to the detail view with the appropriate information on it (covering up the DetailViewController's default UIView). I've created two new UIViews, corresponding to each segment, and I'...

How to dismiss the MFMailComposeViewController in cocos2d ?

I have changed my code to this way. Now mail controller is opening in landscape mode. But the problem is If I touch on cancel button or send button the mail controller is not dismissing its view. How can I do it ? -(void)goToFirstScreen:(id)sender { NSLog(@"goToFirstScreen: "); CCScene *Scene = [CCScene node]; CCLayer *Layer...

How do I take control of creation of the "navigator" of my UISplitView?

I want control over the left hand side of my UISplitView. For now I just want to control the creation, so I'm able to set the UITableViewStyle. But I also want to know how the heck I can use a different class to UITableView altogether. Any pointers? ...

How to get last edit point of editing a UITextView?

I am trying to get the last editing point of a UITextView box. I have tried getting the value textView.selectedRange.location,but it always comes out as 2147483647 (which is -1). When should I read this value ...

Generate vCard from AddressBook.framework

I'm utilising the AddressBook.framework in my iPhone app, and I'd like to replicate something along the lines of the share feature in Contacts.app. This basically attach's a specific contacts vCard to an email. As far as I know, there is nothing in the documentation that mentions generating a vCard. Is this a case of generating one myse...

IBOutlet UILabel do not get resized

HI all, I have designed a view in Interface Builder and connected correctly with its controller. There some UILabel in it that are going to be filled with lot of text. But, even if I have declared "word wrap" and set line to 0 in IB, I can display only first line. I notice that if I increase the height of the UILabel in IB, all the text...

Save method in cocoatouch?

What is the save method for cocoatouch? I need to add it where the comment is: // whatever you want to do. - (BOOL) webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)ntype { if ([request.URL.scheme isEqualToString:@"hide"]) { // whatever you want to do. ...

Resizing a UIView - expanding the top

I have a UIView inside of a UIScrollView that I want to resize. I can increase the height easily by : CGRect frame = self.drawinView.frame; frame.size.height += 100; self.drawinView.frame = frame; self.drawinScrollView.contentSize = CGSizeMake(frame.size.width, frame.size.height); And all is good. The above code will create a new ar...