uikit

UIButton event 'Touch Up Inside' not working. 'Touch Down' works fine.

I've got a UIButton in a UIView, which is in a UIViewController that I've allocated and inited from a .xib file. When hooking an IBAction up to the 'Touch Down' event of a UIButton it triggers correctly. But if I hook it up to the 'Touch Up Inside' event it doesn't respond. Other events don't work either. 'Touch Drag Enter', 'Touch Dra...

UIImage copy ends up rotated

I am trying to copy a uiimage (ultimately I am planning to blur the copy). Right now the copied image shows correctly in the simulator but ends up rotated 90 degrees when running on the device. I am using the following to create acopy: CGImageRef cgImage = [sourceImage CGImage]; // Make a new image from the CG Reference UIImage *c...

Draw an image in Additive Blend Mode without using OpenGL

Hey guys, I want to draw an image using an additive blend mode. But I don't want to use OpenGL. I can't find anything to do this, maybe there's something in Quartz2D? Can anyone point me in the right direction? Cheers, Rich ...

Layout Manager, or is there a better solution?

I have a table view where cells can display a variable amount of information. For example, the first cell could display 2 labels, the next cell 5 labels, and the third cell could display 1 label. The cell contents are stored in managed objects. I would like to make this data driven, where I have a plist to configure the cells. I'm think...

Hierarchy of iOS App UI

I am getting confused reading about CALayers, UIViews and View Controllers. Can someone explain the relationship each of those have to each other (and include anything I might have missed?). I am particularly interested in a View that may have more than one layer. Does that mean the the View Controller has multiple UIViews or that the U...

Create a grouped tableview with gradient on its border

Hey everybody, I need to create a grouped tableview with gradient on its border (not on its cells). I made some research on the web but I'm not sure I understand how to proceed. A little help could really unblock me in my project :). Thanks ...

Nested UIScrollViews scrolling simultaneously

I have two nested UIScrollViews: the parent limited to horizontal paging and the child limited to vertical scrolling. The content is one large view that can be freely dragged around, but snaps to one of three horizontal sections. The default behavior of the nested scroll views is to only allow scrolling in one direction at a time, but ...

UINavigationBar topItem/items seems to double-pop on back

I am managing my own UINavigationBar. I need to do this due to extensive skinning. The documentation for UINavigationController warns that there are limitations to skinning the UINavigationBar when used with a UINavigationController. I have put in extensive logging and from everything I can tell, pushing the "Back" button in the UINavig...

Iphone App: How to fill an image with empty areas with coregraphics?

Hello I'm a begginer developing apps for Iphone and was wondering if is possible to do the following: I have an image .png wich is a simple draw of a figure bounded with black edges and empty areas. I wonder if there is a method or a mode to fill the closed empty areas of the image. Its like as the pot of MSpaint filling. I have thi...

Using Core Graphics to paint a custom 'tab top' label

I've been coding with the iPhone SDK for nearly a year now and managed, up til now, to avoid Core Graphics. My question might therefore look quite simplistic. I need to implement a class that resembles a real-world 'folder tab'. Here's a mockup .. I've been getting by with UILabel, and have tried to subclass it, implementing a drawRe...

How to cancel all touch event sequences in the app

Is there a way to tell the system to cancel all touch event sequences that are currently happening in your app? In one part of my app, I show a new view when a user selects a particular table cell. But, I want to make sure they aren't simultaneously touching any other buttons. For example, if they are holding a toolbar button while th...

UIButton oversensitive

I have a UIButton defined within a tableviewCellWithReuseIdentifier. The button works but it's very touchy. If I just tap the button it works. Pressing it any long fails to trigger the action, even though it does flash showing that it knows it was pressed. Why is this happening? More importantly, how can I fix it. Here is the code for ...

Saving masked UIImage to disk

Hi there, I'm trying to save a multiple masked image to disk. The code below explains How I do it. The maskImagewithStroke masks 2 times a picture : first time to provide an irregular stroke to a texture then I'm remasking it with a bigger mask to get a stroke from it. It's the bast way I found to get an irregular stroke around my text...

When is viewDidLoad called?

Is it safe to assume that an attribute, namely fetchedResultsController, of chatViewController, an instance of a subclass of UITableViewController, is always nil when viewDidLoad is called, assuming that it's set to nil in viewDidUnload? Phew! If that's the case, then I see no immediate need to redefine the accessor function like in the...

implementing protocol methods in objective-c

If I have an protocol (say UIPickerViewDataSource) and I implement its required methods, do I need to declare those methods in the header file of my class? At the moment I'm not doing so and I get a warning of incomplete implementation (although everything works fine). If I do add the required methods in the then I don't get such warnin...

Using a UIWebView to display and watch a log.

My app is retrieving text from a web service in chunks. I am displaying the formatted text using a UIWebView. So far so good. My problem is as each chunk arrives, I need to refresh the web view with the new content. I am using KVO to observe changes in the text, and when the text changes I'm calling [self loadHTMLString:self.log.text b...

How do I make a pretty UITextView that expands as needed (like the one used in the SMS app)?

It should: Expand vertically whenever new lines are added with the return key. Wrap long lines and expand vertically for wrapped lines as needed too. Have a nice pretty border just like UITextField. Support placeholder text just like UITextField. Support friendly actions like UITextField. ...

iphone simulator and "DONE" keyboard button for UITextField

Hello, I have problem probably the same like this guy: When clicking on text field, after entering data, "done" button doesn't work?? Is it iphone simulator issue? Please tell me how to get the "done" button work with Interface Builder only. Solution: After googling for 50min I finally understood my problem. And now in plain english...

Running activity indicator NOW

I want to start an activity indicator before going to disk I/O. How do I start the indicator NOW, instead of waiting for the next display loop cycle? Or how do I force the display loop before beginning the disk I/O? Dan ...

Adding UILabel to custom UITableViewCell

Hi, I am working on custom cell in uitableview and trying to add uilabels in the cell but not able to set text on it. Following is how i am trying to add the cell and also how i am adding the text - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *MyIdentifier = @"M...