cocoa-touch

How to change a grouped UITableView cell's background to black (or non-white)?

Just want to make sure I'm not overlooking something obvious... It seems like it should be trivial to set the background color (black is fine) of a UITableView's cell to something other than white or completely transparent so that you can display your data with white text. However, with my attempts I lose the corners on my grouped table ...

UITableView - how to pass-through touches to parent view

I have this setup: UIView UITableView UIView The nested view is hidden initially and I want it to show up when user touches the table view anywhere, on cell, outside section - just about anywhere on the screen outside status/nav. bar. I added touchesBegan for the main view (in which I show the nested view) and when TableView is hi...

UINavigationController's back button disappears?

I notice something strange happens to one of my view controller: the back button disappears, yet it's possible to go back to previous view controller by tapping the top left corner (i.e where the button should reside). In my entire file there's no line that set self.navigationItem.hidesBackButton to YES; also NSLog prints 0 as self.navi...

How can I delay a method call for 1 second?

Is there an easy way to achieve that? I have an UIImageView that reacts on a touch event. When the touch is detected, some animations happen in the App. After one second I want to call another method. In this case, I can't use the animationDidStop selector. ...

Does it help to start intensive core animation blocks in another thread?

I have an scroll view with some sophisticated animations happening during scrolling. Although after 2 weeks of finetuning the performance is acceptable now, the scrolling is not 100% smooth when the animations happen. I know that core animation does animations in a background thread. But I wonder if it would help to split those animatio...

Is there an easy way to get the creator object of an object in objective-c / iPhone-OS?

Example: I have an class that inherits from UIImageView. An object creates an instance from that class. Now, that class needs a weak reference to it's parent. I could make an initializer where the object has to pass "self" to the new created object. But I feel that there is a better way. Is there any? ...

Switching views with busy indicator in cocoa touch

I'm loading a view from a tableview touched cell that contains a photo that is downloaded from the web. I've set up a busy indicator that is called when the cell is touched and then turn it off in the viewdiddisappear method but when you touch the cell there is still a long pause when the cell is touched then the busy indicator shows u...

getting touches in UIResponder API

So, UIResponder has methods like: - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event My question is, what's the difference between the touches parameter, and [event allTouches]? ...

Adding UITextView as subview in UIView then to UIScrollView

I have a UIViewController (ContentViewController ) wired to a View xib. I drop a TextView on the UIView and it appears as a subview in the hierarchy in IB. ContentViewController has a label as an outlet, which is wired to a label on ContentView.xib. When the code below executes, the first view shows the text view but scrolling through...

Checking if a .nib or .xib file exists

What's the best way to check if a Nib or Xib file exists before trying to load it using initWithNibName:bundle: or similar? ...

Main thread's NSRunLoop being referenced in a secondary thread

Hi all, I was just recently futzing about with a sample application trying to get my head completely wrapped around NSRunLoop. The sample I wrote created a simple secondary thread via NSOperation. The secondary thread does a few tasks such as process an NSTimer and also some rudimentary streaming with NSStream. Both of these input sourc...

Is there a way to remove the separator line from a UITableView?

Hi, I'm looking for a way to completely remove the separator line in a UITableView when in the plain mode. This is done automatically in grouped, but this also changes the dimensions of the table in a way that is hard to measure. I have set the seperator line color to colorClear. But this does not completely solve the problem. As I am t...

Cocoa Touch App Architecture - MVC controller?

I am quite new to Cocoa and to iPhone programming. I am using the Xcode Utility Application template to implement a simple app that has: a view with a text field to collect a username a view with a connect button to start a connection to a remote site using the username to get some data via HTTP. The data will be presented as a text ...

Remove character from NSString in iPhone programming?

NSString *myString = @"A B C D E F G"; I want to remove the spaces, and get a string out like "ABCDEFG". Please help me... Thanks and regards ...

How to make a UIView subview NOT scroll.

I have a subview over my UITable that is used as a "busy view". It holds an activity indicator and labels. I call it when the program is going to download a photo that is indexed in the cell. All that works fine but the problem is that when I'm scrolling down the UITable and then click on a cell and the "busy view" gets added it will sho...

Core Data NSPredicate for relationships.

My object graph is simple. I've a feedentry object that stores info about RSS feeds and a relationship called Tag that links to "TagValues" object. Both the relation (to and inverse) are to-many. i.e, a feed can have multiple tags and a tag can be associated to multiple feeds. I referred to http://stackoverflow.com/questions/844162/how...

UIScrollView - Adding / Removing labels

I am trying to add/remove UILabels to a ScrollView. The adding takes place just fine, but I can not seem to get the labels removed, before adding new ones. Can anyone shed some light on this situation? -(void)setMessage:(MessageData *)m{ //Attempting to remove any previous labels iPhone_PNPAppDelegate *mainDelegate = (iPhone_P...

iPhone Rotation of UINavigationController view as Subview

I'm having a problem getting a UINavigationController to lay its table out properly after autorotation, when the UITableview is a subview. What happens, is that the navigation bar gets shifted down about 20px, and the table becomes either too short and too wide in landscape, or too narrow in portrait. Anyone have any suggestions? Thi...

Query available storage on iphone

Is it possible to determine how much free storage is left on the iphone using the iphone sdk? I'd like to adapt the cache size depending on how much space is actually left. ...

UITableViewCellEditingStyleInsert or UITableViewCellEditingStyleNone ?

I have data edit controller similar to the EditableDetailView sample from the SDK. The view shows only the fields with values in the non-editing mode and in editing mode it adds the unpopulated fields too as placeholders. Unlike the SDK example the set of fields is fixed so no new placeholers have to be added during edit. My question is ...