cocoa-touch

iPhone SDK - How to take a picture with custom camera view?

Hi, I want to release the shutter as soon as the user tabs on the screen. I have working code for displaying the camera in fullscreen mode. How can I trigger the shutter by a touch? - (IBAction) takePicture { if (!self.imgPicker) { self.imgPicker = [[UIImagePickerController alloc] init]; self.imgPicker.allowsEditin...

What resolution does my in-app artwork need to be?

What resolution does in-app artwork need to be to make use of the high-resolution iPhone 4 display? ...

Cocoa Touch - Moving an UIIMageView around on screen

Whats a simple way to let the user drag an imageview around to position it in the place of their choice. Its for a photography app. Thanks! ...

How to set a gradient UITableViewCell background?

I would like to create a gradient UITableViewCell background like the default Clock app that comes on the iPhone. I am not exactly sure how to accomplish that. Do I create an image and set it: cell.contentView.backgroundColor = [UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"background.png"]]; or is there another/better app...

Problem removing multiple objects from NSMutableArray iPhone SDK

I am having trouble removing objects from nsmutable array. Here it is. NSURL *url = [NSURL URLWithString:@"http://www.lockerz.com/dailies"]]; NSData *datadata = [NSData dataWithContentsOfURL:url]; NSString *removeForArray = [[NSString alloc] initWithData:datadata encoding:NSASCIIStringEncoding]; NSArray *theArray = [removeForArray co...

NSFetchRequest predicate syntax

Hi, I have an entity called Task in my Core Data model. The Task entity has a transformable attribute called date. The class of the date attribute is a class called TDate (which conforms to NSCoding, therefore being a transformable attribute). TDate has a property of type NSInteger called month. In my NSFetchRequest I want to get all ...

Using an NSFetchedResultsController without a UITableViewController

I'm running into problems trying to use a NSFetchedResultsController without a corresponding UITableViewController. According to Apples documentation: "NSFetchedResultsController is intended to efficiently manage the results returned from a Core Data fetch request to provide data for a UITableView object." So I first researched whethe...

Play local notification default sound when displaying UIAlertView?

I'm writing a reminders app for iPhone that displays reminders using local notifications. If a reminder goes off while the application is running, the local notification isn't displayed. Instead, the didReceiveLocalNotification method is called in my app delegate, and I mimic the local notification dialog by displaying a UIAlertView wit...

Have UITouch only perform task when touching certain color

How can I have UITouch recognize and perform a certain task ONLY when I touch a certain color in a UIImage view. For example: I have an image of a street. The street has greyish buildings and a white road. If I touch a building, I don't want anything to happen, but if I touch a white road, I want to highlight that section where I tou...

How to select rows while in edit mode?

I have a UITableView that is editable. I am commiting changes via: - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath While in edit mode, I would like the user to be able to select a row, which will push a new view. I am not sure how to do ...

Cocoa Touch - Table View and Cells Help

I want to parse a CSV into cells but I dont know how to add more than one cell to a table. Do I need to create multiple versions of this method for each cell? Teach me! - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableVi...

Release message to a UINavigationController object

Hello, I am relatively new to Cocoa programming, and some aspects of memory managing are still troubling me. In this case, I am creating a UINavigationController using the alloc message, and initialising it with a UIView controller. Then, I am presenting the view modaly by passing it to the presentModalViewController method. Below is ...

How to show disclosure indicator while cells are in edit mode?

I have a UITableView that can be edited. I am displaying cells as such: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) {...

Keeping backing CAGradientLayer static when UITableView scrolls

I'm trying to use a CAGradientLayer as a background for a UITableView. Everything works well until the overlaying view is scrolled, at which point then the pre-rendered background scrolls up and out of the way along with the original screen of data. This is code that is being migrated from an iOS 3.1.3 app using a UIImage as a backgroun...

App suddenly crashes when run on Device

My app runs great in the simulator, and has been working great on device as well. Today I am trying to install on device and the app crashes. It still works in the simulator. I am getting no debug errors: [Session started at 2010-07-19 10:35:01 -0700.] GNU gdb 6.3.50-20050815 (Apple version gdb-1470) (Thu May 27 05:54:06 UTC 2010) Copyr...

Creating Objects & Setting iVars in a Loop?

NSArray *planetArray = [NSArray arrayWithObjects:@"Earth", @"Jupiter", @"Saturn", @"Neptune", @"Pluto", nil]; NSMutableArray *objectArray =...

checking which UITextField is triggering textFieldShouldBeginEditing call

What's the best way to determine which UITextField triggers the method -(BOOL)textFieldShouldBeginEditing:(UITextField *)textField (or any of the other UITextFieldDelegate methods)? I've seen code like this before: - (BOOL)textFieldShouldBeginEditing:(UITextField *)textField { if (textField == textFieldCode) { return YES; ...

UIButton Touch and Hold

I haven't found a very easy way to do this. The ways I've seen require all these timers and stuff. Is there any easy way I can hold a UIButton and cause it to repeat the action over and over until it gets released? ...

model and view in a simple strategygame with cocos2d&cocoa touch

Hey i need some general advice on how to structure my project. i am trying to make a simple strategygame where some object move around in a "worldspace" and youve got several different tactical views, which show diffent areas of the game. nothing special. but since i'm a rather unexperienced programmer, some things are not quiet clear to...

Objective-C - Parsing a CSV into a array

How would I parse a CSV into an array. Its only a one column spread sheet I converted into an CSV so it shouldn't be too hard right? Any way how do I do this? ...