cocoa-touch

commit object to next TableViewController

i got a tableview controller. if a cell is selected i perform the following: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { ablogSingleCatTableViewController *singleCatTableViewController = [[ablogSingleCatTableViewController alloc] initWithStyle:UITableViewStylePlain]; // Push the detail...

How do I convert from NSString to NSDate?

how to convert from NSString to NSDate ? it must be in yyyy-MM-dd HH:mm:ss this format when it converts from NSString to NSDate format ...

How to update a detailView in a splitViewController?

Hello, I'm trying to update a detailView in a splitViewController. This is what I try: //Get the application delegate AppDelegate *delegate = [[UIApplication sharedApplication] delegate]; //Get the masterViewController MasterViewController *master = [delegate.splitViewController.viewControllers objectAtIndex:0]; This seems to work f...

Cocoa touch view with multiple identical subviews

I'm having my first foray into Cocoa Touch programming (and one of my first into Cocoa in general) and writing a simple game for the iPhone, though this question is about cocoa touch in general. The main UI consists of a strip of identical acting buttons (only varying in colour) arranged horizontally across the screen. Although they act...

Why does NSDateFormatter return nil?

Why is lDateFormatted nil on iPhone simulator 3.1.2 after executing this piece of code? NSString *lDateString = @"Wed, 17 Feb 2010 16:02:01"; NSDateFormatter* dateFormatter = [[[NSDateFormatter alloc] init] autorelease]; [dateFormatter setDateFormat:@"EEE, dd MMM yyyy hh:mm:ss"]; NSDate *lDateFormatted = [dateFormatter dateFromString: l...

Picker, access to dataSource?

I am just learning how to setup a multiple picker and I am a little curious about the two labeled sections below: // METHOD_001 NSInteger row_001 = [doublePicker selectedRowInComponent:0]; NSInteger row_002 = [doublePicker selectedRowInComponent:1]; NSString *selected_001 = [pickerData_001 objectAtIndex:row_001]; NSString *selected...

UITableViewCell textLabel and detailTextLabel tags?

I am designing an interface that basically looks the same as the Settings application. That is, I have a grouped TableView with cells that look like UITableViewCellStyleValue1. There are labels with values associated with them. The difference is, I am making custom UITableViewCell nibs so that the "value" can be a textbox, segmented cont...

UIScrollView - with paging enabled, can I "change" the page width?

What's the simplest way to have a scroll view (with pagingEnabled set to YES) have a page width set to something other than the scroll view's bounds? Let me give an example. Suppose I have a scroll view with 10 items, each 150 pixels wide, and my scroll view is 300 pixels wide. If I start with views 1 and 2 visible and scroll horizontal...

Do I need an '@class' declaration in my AppDelegate.h file for every view controller in my project?

Please explain your answers as I've gotten away with not having to do this so far. Thanks ...

Finding the top of mapview

From an MKCoordinateRegion, how do I tell what the top of a mapview's visible area is? The MKCoordinateRegion will have a center point (coordinates). Do I then add the latitudeDelta to the center point latitude to find the top of the map? Or must the delta be split in half and each half added and subtracted against the center point la...

connecting events to actions during runtime

i know how to create a control during runtime, my controller class has a IBAction method inside it. How do i connect the event associated with a control to the IBAction method. Just like ctrl+drag inside Interface builder except during runtime ...

Move an imageView along a circular path

Hi all! I'm developing a game in which I've imageviews for bow and arrow. I actually wanted to move this arrow along a circular path when set in the air. Specifically, this circular path should be the one which an object will travel when thrown in the air at a distance i.e. it'll move upwards first and then downwards. I've already trie...

UIViewController created with initWithNibName: bundle: or via an IBOutlet behave differently

I found a strange behavior, and would like to be explained what assertion I am making that is wrong. In an AppDelegate class of a freshly created WindowBased project, I am adding a UIViewController to the window. I can do it two different ways: - with an IBOutlet. In IB, I simply instanced an UIViewController, set its class to TestView...

How to navigate back to previous view after sending sms is done in iphone?

Hi, I am new to iphone development, i have created sms application using "Text Links(sms:) and i have created the action sheets and the buttons for email, sms. On clicking sms it navigates to the another view(UIView controller) and i wrote a code for SMS.And i faced some problem ,its not removed the view properly, it doesnt goes to the ...

Removing and adding persistent stores to a core data application

I'm using core data on an iPhone application. I have multiple persisntent stores that I'm switching from one to another so that only one of the stores can be active at the time. I have one managed object context and the different persistent stores are similar in data format (sqlite) and share the same managed object model. I'm importing...

Properly sizing view in -loadView

I'm having a problem getting my view to be sized properly when created via -loadView. It seems that my view frame is always (0, 0, 320, 460), even when the view/controller is nested inside a UINavigationController and/or UITabBarController. Is there a way to detect programmatically when my view controller is nested within these items, ...

object crashes Application

Hi out there. i got an NSArray which gets filled in the init Method of my UITableViewController. i use this object in "didSelectRowAtIndexPath" for pushing another tableviewcontroller. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { ablogSingleCatTableViewController *singleCatTableViewCont...

Avoiding compiler warnings when doing message forwarding

I created a class that wraps a UITextView and adds some ui elements. I want the new class' API to be identical with UITextView, so I use message forwarding (listing below) to relay messages between the wrapped text view and the delegate. The irritating thing is that the compiler issues warnings for method invocations on instances of my ...

Add integers from 5 UITextFields to a UILabel in Cocoa Touch

I'm trying to sum the integers from five UITextFields and post them to a UILabel. This is the code I have tried, but it doesn't work properly. The number that shows up in the label is not the sum of my textfields. I have also tried to post to a textfield instead of a label, with the same result. No errors or warnings when I build. int ...

Deleting Core Data object before popping a view from the UINavigationController

The following code deletes a core data object if the user did not end up modifying the new entry (this happens on an insert operation). The root view controller created the entity and passed a reference to my view. It works fine if the user hits a "done" button on my view, but if instead they navigate backwards using the "back" button on...