Implementing a searchbar can be tricky business and I'm struggling to make it work for my situation. Here's a collection of some of the sample code I've found for implementing a UISearchBar. Please share any others below you've come across below.
Apple's TableSearch code implements a contacts-like search of a simple tableview.
Beginnin...
I want to compare the value of an NSString to the string "Wrong". Here is my code:
NSString *wrongTxt = [[NSString alloc] initWithFormat:@"Wrong"];
if( [statusString isEqualToString:wrongTxt]){
doSomething;
}
Do I really have to create an NSString for "Wrong"?
Also, can I compare the value of a UILabel.text to a string without ...
See topic. It's just with one application -- 2 of them work fine, but the third (and largest, go figure) doesn't respond to touch events. I tried changing a UIImageView's location on TouchesBegan, and that doesn't show up (but it does in the Simulator!)
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
UITouch *touch =...
I'm working on an iPhone app with a lot of different gesture inputs that you can do. Currently there is single finger select / drag, two finger scroll, and two finger pinch zoom-in / zoom-out. I want to add in two finger rotation (your fingers rotate a point in between them), but I can't figure out how to get it to work right. All the ot...
Hi,
In iphone application
I want to show a countdown timer in TableView row. Any suggestions and coding help?
Thanks,
Aaryan
...
I need some help coming up with an algorithm to determine the minimum bounding rectangle around a set of lat/lon coordinates. It is OK to assume a flat earth since the coordinates will not be too far apart. Pseudocode is OK, but if someone has done this in objective-C, that would be even better. What I am trying to do is set the zoom ...
FMDB runs great in the simulator, but I get the following errors when I try to run it on the device.
"_sqlite3_step", referenced from:
-[FMResultSet next] in FMResultSet.o
-[FMDatabase executeUpdate:arguments:] in FMDatabase.o
"_sqlite3_column_name", referenced from:
-[FMResultSet setupColumnNames] in FMResultSet.o
...
I'm have a number rows I'm inserting into a table using -insertRowsAtIndexPaths:withRowAnimation, and I would like the rows to be indented from the left to distinguish them from the rest of the cells. The indentationLevel property of UITableViewCell looks like it's exactly what I need, but it doesn't seem to do anything. Here's the code ...
I'm using a UITableViewCell with UITableViewCellStyleSubtitle. However, because of the background image I'm using for the cell, I don't like where the detailTextLabel is going. I want to move it and resize it within the cell, but nothing I try seems to work.
CGRect currRect = cell.detailTextLabel.frame;
cell.detailTextLabel.frame = CGRe...
With MapKit in the iPhone 3.0 SDK, you create objects that conform to the MKAnnotation protocol. Loading these onto the MKMapView is very easy. However, when a user scrolls the MKMapView, it's time to load new annotations. A likely place to request the new objects would be in mapView:regionDidChangeAnimated: which is called when the map'...
Without getting into OpenGL (Quartz 2D is OK):
Let's say I have an image which I want to move across a map in some fluid way. For instance, an image of a plane "flying" across the map. I've been able to do this using an MKAnnotation, an NSTimer and fiddling with the rate of lat/lon change and timer rate. However, I assume this isn't id...
I am working on an app that has several views selected using a tab bar. One tab displays a list of data using a table view. Another tab uses a table view (and a navigation controller) so the user can add items to/delete items from the list.
If the user switches to the first tab after adding or deleting items on the other tab, the app...
I know how to draw a simple line:
CGContextSetRGBStrokeColor(context, 1.0, 1.0, 1.0, 1.0);
CGContextMoveToPoint(context, x, y);
CGContextAddLineToPoint(context, x2, y2);
CGContextStrokePath(context);
And I know how to do a gradient rectangle, i.g.:
CGColorSpaceRef myColorspace=CGColorSpaceCreateDeviceRGB();
size_t num_locations = 2;
...
First of all, im finding the iPhone online docs to be not-so-very thoroughly clear when it comes to the various ways of rendering a layer. I get the jist of it, but im not clear when to use which methods and which requires the layer to be added as a sub layer or not.
My project started off trivially with me loading images and simply dra...
I have a UIView subclass that I am doing some custom drawing in. When drawRect:(CGRect)rect is getting called rect.size is either (64, 63) or (63, 64); self.frame.size is (64, 64).
I have multiple instances of this subclass, most of which get the expected (64, 64) size for the drawRect parameter.
What are conditions that may cause some...
Hi Developers,
I am struggling with converting a recorded pcm/caf file (recorded via the AudioQueue) to a m4a file. I should be possible somehow with the "AudioConverter.h" but doesn't seem to be easy at all.
If you have seen an example or have a code snippet it would be great if you can post it.
Thanks for your help
Tom
...
hi , i want to restrict user from entering space in a UITextField. for this i m using this code
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
if ( string == @" " ){
UIAlertView *error = [[UIAlertView alloc] initWithTitle:@"Error" message:@"You hav...
I have problem with customizing each page using pagecontrol and UIScrollView.
I'm customizing Page Control from Apple.
Basically I would like to have each page different with text and image alternately on different page. Page 1 will have all text, Page 2 will have just images, Page 3 will have all text and goes on.
This is original cod...
I want to do an Asynchrous NSURLConnection inside of an NSOperation on a background thread.
(it is because I'm doing some very expensive operations on the data as they come back that want to be done as the data comes in and in background)
Here is my first attempt:
IN my AppDelegate:
// create the opperation and add it to the queue:
s...
Both appear to have the exact same effect. They come both when the finger is far enough away from the control. The "bounds" is not really the criteria for UIControlEventTouchDragExit. It gets fired only if it's far away enough...
...