MacUser
MacUser

Reputation: 491

Table View edit add rows with modal view Xcode 4.2

I am developing an app with a tab bar and drill down table views in Xcode.

I am intending to allow the user to add custom rows to the table and intending to do this through a modal view controller containing a text field.

I don't know how to get the data from the text field in the modal view to a new row in the table. Can anyone point me to an example/tutorial?

Upvotes: 0

Views: 562

Answers (1)

Rama Rao
Rama Rao

Reputation: 1033

Just take a string variable in delegate class synthesis it and use it in modal view controller by storing text field value into it.Then use it where u require.

In delegate class.h

`@interface

{ NSString *str; } @property (nonatomic , retain) NSString *str; ` In delegate class.m

@synthesize str;

after @implementation class.m

In other class take one delegate class object and then in viewDidLoad method you code as

obj = [[UIApplication sharedApplication] delegate];

and store value into str as

obj.str=@"ram";

Upvotes: 1

Related Questions