cocoa-touch

Is there a difference between delegate/selector and target/action?

When writing Cocoa and implementing a class method that accepts a delegate and one or more selectors to use for its callbacks, does the terminology change from "delegate" and "selectors" to "target" and "action"? More to the point, is "delegate" limited only to when my class is the one getting called, but not when my class is doing the ...

Nested UIScrollViews in [REDACTED] - Controlling Which View Gets the Touch

I have a paged horizontal scroll view which houses uiwebviews. Scrolling side to side triggers the container uiscrollview scroll. Scrolling perfectly up and down triggers the uiwebviews scroll. Anything less than a perfect up-down swipe cause the horizontal scroll to trigger. This is all out-of-the-box [REDACTED] code. What I desire...

Removing titlebar from 'Utility Application's flipside view

I've put a table on the flipside of my Utility Application template. The template automatically puts a titlebar with a done button to go back to the front view. When one of the cells in the flipside's table is selected, it brings up the Camera / Image Library picker. But it leaves the titlebar is position, partially obscuring the picker...

Using fonts that aren't on iPhone

I'd like to use some fonts that aren't part of the iPhone OS. I've seen games that use non standard fonts. I can install the fonts, create images for each one in Photoshop and then use those images in the iPhone app. However, I don't think that is a practical way to go. If the color or tint needs to be adjusted (because of background...

No touchesbegan: in live camera area of UIImagePickerController

Hello, in my UIImagePickerController (camera shooting view), I want to track touches. Every touch event gets properly called except for touchesbegan: It's not a typo or something because touchesbegan: had been called up to the moment, I've changed the controller from UIViewController to UIImagePickerController. Why is touchesbegan: no...

Convert Textview text to post request parameters -- iphone development

I want to pass my textview content to a server via post request but I guess I have a problem with encoding. Do | have to convert say blanks to + or %20 by hand or is there a library supported by cocoa or any other 3rd party? Is this sth trivial ? I got stuck with this simple step for hours! :) ...

Fast Scrolling in Tweetie with UITableView

On December 12th 2008, the maker of the Tweetie IPhone App posted a great example how he accomplishes UITableView scrolling without the jagged/raggedness that normally entails. His example code works great with version 2.2 of the SDK, however, when I compile for 3.0 I cannot get the click-highlight to work on an individual cell. Anyone...

UITouch nil in touchesMoved with light tap-slide

I have a view object that I can tap and get a valid touch in touchesMoved: - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [[event allTouches] anyObject]; If I lightly tap while sliding the object, touchesBegan fires and I call touchesMoved, as before, but this time touch in touchesMoved is nil. An...

comparing dates in iPhone programming

How do you compare the current date with another date in iPhone programming.. eg: Date1= 1-10-2008 Date2=15-06-2009. i want know Date1 is a future date or a past date..? pls help me with code... thanks and regards.. raju ...

How do I detect a rotation on the iPhone without the device autorotating?

Anyone know how to do this? I thought this: -(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return YES; } - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { } - (void)willAnimateRotationToInterfaceOrientation:(UII...

Getting visible cell from UITableView pagingEnabled.

I have a UITableView with pagingEnabled. Each cell takes up the viewing area of the table. Meaning, each cell is the same height and width as the table. I'm using custom cells that have a name property. I'd like to display the name of the current (viewable) cell in a label. This works fine for the first and last cells but anything i...

How to make section headers in multiple languages

Hi, I have an UITableView, and in it I have different sections - words that start with letter "A" go to the section "A". Words that start with letter "B" go to section "B" and so on. Here is my code: -(void) populateTable { if (tableDataArray) { [tableDataArray removeAllObjects]; } for (int i = 0; i <= 27; i++) ...

How to create a multistage UIImageView animation?

I'm trying to do a multistage animation, so that a UIImageView (1) fades in, (2) moves, (3) slide off the screen. Only stage 1 seems to work. What am I doing wrong? Here's the code: // FIRST PART - FADE IN -(void)firstAnim { // 'sprite' is a UIImageView [sprite setAlpha:0.1f]; [UIView beginAnimations:@"anim1" context:NULL];...

Convert NSString to NSDictionary

Is there a way to get an NSDictionary back from the string created via its description method? Given this code: NSDictionary *dictionary = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"value 1", @"value 2", nil] forKeys:[NSArray arrayWithObjects:@"key 1", @"key 2", nil]]; NSString *dictionaryString = [dictionary descr...

How to deal with non-visible rows during row deletion. (UITableViews)

I am performing a deletion of several rows of a table. In fact, on this occasion all visible cells are in fact deleted. This causes the cell immediately below the visible frame to become visible after the animation, since all cells above it are now gone. Here is the issue, this cell is also deleted. So I get the following error, I assu...

how to change the UIImagePickerController crop frame

when opening working with an UIImagePickerController and setting allowsImageEditing = YES; there is a default cropping frame that is 320x320. In my case, I would like to setup that cropping frame to 320x240 for images that are landscape, and 240x320 for images that are portrait. However, I haven't been able to find a way to change that ...

Pattern to update a UItableView and its datasource after filtering with NSPredicate.

This seems like it should be straight forward. Technically I can make this work, but if I want to perform certain UI animations, (using deleteRowsAtIndexPaths:withRowAnimation:) things get hairy. It seems as though the datasource and UI are fighting over who should delete first. Then I have to artificially keep data around for the UI up...

Passing variables in objective C

Normally i've been passing variable around in init methods, but I can't do that this time because I have a var in one ViewController class displayed using a tab bar and I need access to it from a different ViewController class when a different tab bar is pressed. My understanding was that you can access vars using @property but it's now ...

uibutton events with @selector

-(void)myButtonclick { NSString *data=[[NSString alloc]initWithString:@"YES U PRESSED BUTTON"]; UIButton *refreshbutton=[UIButton buttonWithType:UIButtonTypeCustom]; [refreshbutton setFrame:CGRectMake(15.0f, 330.0f, 150.0f, 32.0f)]; [refreshbutton setCenter:CGPointMake(80.0f,340)]; [refreshbutton setBackgroundImag...

How to delete the last row of a section?

Hello, This problem has kept me busy for the last hours. I have two sections with one row in each section. When I delete the row in one of the sections than it throws an exception saying this is an invalid update (number of rows/sections before and after the update are not the same). This is understandable as I delete the last row of a ...