Solved

How to display NSMutableArray Value in Table

Posted on 2012-04-06
9
581 Views
Last Modified: 2012-04-07
2012-04-06 16:25:47.998 Smart Buddy[1521:f803]
( "Request A Quote" )
2012-04-06 16:25:47.999 Smart Buddy[1521:f803]
( "Contact US" )
--------------------------------------------------------------------------------------------------------------------------

How to bind above data in UITableView?

I want to display both records display in table, my code is

--------------------------------------------------------------------------------------------------------------------------
static NSString *CellIdentifier = @"Cell";

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
    cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
NSUInteger row = [indexPath row];



cell.textLabel.text =[formData objectAtIndex:row];
// Configure the cell...

cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;

------------------------------------------------------------------------------------------------------------------------------------------
formdata is my NSMutableTableArray

Please give me solutions.

Thanking you..
return cell;
0
Comment
Question by:citadelind
  • 5
  • 4
9 Comments
 
LVL 13

Expert Comment

by:SpeedyApocalypse
ID: 37817943
In the cellForRowAtIndexPath method, NSLog your formData array.  Perhaps it is nil at that time, and that is why your textLabel's text property is not receiving anything?  Could you post where you initialize the formData object as well?
0
 

Author Comment

by:citadelind
ID: 37818340
i attached my code

Please check it where is made mistake?

Thanking you..
0
 
LVL 13

Expert Comment

by:SpeedyApocalypse
ID: 37818346
Could you post where you initialize the formData object as well?
0
 

Author Comment

by:citadelind
ID: 37818354
I attached doc file, whole my code,
Please check it

It will be initialize the formdata

Thank you
code.doc
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 13

Expert Comment

by:SpeedyApocalypse
ID: 37818364
In your cellForRowAtIndexMethod, add an NSLog with the formData array.  Like so:

NSLog(@"%@",formData);

Open in new window


From there, see if anything is outputted to the console.  If not, you know that formData contains nothing when your table is requesting it.
0
 

Author Comment

by:citadelind
ID: 37818383
yes it is return below value

2012-04-06 16:25:47.999 Smart Buddy[1521:f803]
( "Contact US" )

------------------------------------------------------------------------------------------------------------------------------
but i have 2 output soap result and when i check this event so it will show 2 output

-(void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string
  {       
      if( recordResults )       
      {             
            [soapResults appendString: string];                        
            [formData addObject:soapResults];    
            NSLog(@"%@",formData);            
      }      
}
it will give output this
2012-04-06 16:25:47.998 Smart Buddy[1521:f803]
( "Request A Quote" )
2012-04-06 16:25:47.999 Smart Buddy[1521:f803]
( "Contact US" )

--------------------------------------------------------------------------------------------------------------------------
In formdata add 2 value through soap response, but in my table it will bind only last
value "Contact Us"

How to bind both value in my tableview??

Thank you...
0
 
LVL 13

Accepted Solution

by:
SpeedyApocalypse earned 500 total points
ID: 37818423
Move where you set the formData instance variable to loadView instead of where it is currently and try it.
0
 

Author Comment

by:citadelind
ID: 37818447
nothing to get  anyvalue i put in loadview

Give me proper solution what i do? so both value display on table?

it bind only last value, do not clear my why it takes last value?

Request A Quote
Contact US

Both value bind in table.

Give me solution

Thank you..
0
 

Author Closing Comment

by:citadelind
ID: 37818528
Thanks i got solution......
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
iPhone issues 4 39
Phone service in Israel 4 66
iPhone 6: Testing my battery for failure? 6 65
I need to text message (iPhone) from my MacBook 3 24
In this article we discuss how to recover the missing Outlook 2011 for Mac data like Emails and Contacts manually.
You should read OS supplied guidelines before developing. I can't stress that enough. The guidelines will help you understand the reasons mobile app developers do what they do.  Apple is very particular when they review appstore submissions.
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…
CodeTwo Sync for iCloud (http://www.codetwo.com/sync-for-icloud?sts=6554) automatically synchronizes your Outlook 2016, 2013, 2010 or 2007 folders with iCloud folders available via iCloud Control Panel. This lets you automatically sync them with…

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now