Jump to content
InsanelyMac Forum
Sign in to follow this  
LooN3y

How Can I Make Parsed XML Data Appear On Custom TableViewCell?

Recommended Posts

I'm making a split view iPad product search.

 

 

 

in the debugger, it shows I'm getting the parsed data, it just won't show up on my table view, so i decided to make a custom TableViewCell creating the .h and .m files.

 

 

but i have a problem, i have my XML parser in my MasterViewController, but i want to assign it to a label in my Custom TableViewCell object.

 

 

- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName
 namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName
{
NSLog (@"didEndElement");

if ([elementName isEqualToString:@"description"])
{
	NSLog(@" decription:%@", capturedCharacters);




   StyleMasterCell.textView.text =  capturedCharacters;



}

capturedCharacters = nil;  

if ([elementName isEqualToString:@"str_smartsearch"])
{
	// We are no longer in an item element
   inItemElement = NO;
}
}

 

 

 

i only included description so it will be simple, and I wanna just at least get one thing working first and foremost.

 

 

 

 

this line: StyleMasterCell.textView.text = capturedCharacters;

 

 

does not work, how can i assign the parsed at a to the textView thats in the stylemastercell?

Share this post


Link to post
Share on other sites
Advertisement

Assuming the capturedCharacters isn't NULL (you should be able to tell based on the NSLog you have there above it) , you should be using

 [cell textLabel] setText:@"Foo Bar"];

Try that out and see how it works out for you. (My suggestion would be to use an NSDictionary since it makes assigning key values to cells easy)

 

example

 

Screen%20Shot%202012-05-10%20at%2010.58.14%20PM.png

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.



  • Similar Content

    • By Allan
      We are very close to WWDC 18, so the expeculations are very high. Look at this graphics:

      One of the big expectations for macOS is be a cross-platform system, to help developers bring their iOS apps to the Mac platform.
      Let's see...

      View full article
    • By Allan
      We are very close to WWDC 18, so the expeculations are very high. Look at this graphics:

      One of the big expectations for macOS is be a cross-platform system, to help developers bring their iOS apps to the Mac platform.
      Let's see...
    • By StealthRT
      Hey all I am wanting to create a type of REST app that would allow me to send a command to the iPad mini and have it either turn off and/or disable the home button. 

      I understand that these features would be available with 3rd party/ non-documented apis that would never pass Apples requirements. However, I am only using this app for personal use at home. 

      So has anyone done the above? Is it possible to do using iOS 11 on the iPad mini with Swift/Objective C?

      Thanks!
    • By the_jff
      Hi,

       

      I have a OSX 10.13.2 High Sierra guest running on Win7 pro.

      The guest is only used to configure idevice with Apple configurator2.

      guest and host as the latest itunes version and driver.

       

      I use an iPhone 6 and 6S and it's working perfectly, my problem started when I got 2 new iphone8+ (and later while writing the post, using an iPhone SE, same problem), on the host machine, no problem at all, they work and they are displayed in itunes.

      When I connect to guest, the loop start and I have to physically disconnect the usb cable for it to stop, trying the right-click on icon and connect/disconnect host... not working, it give me a unknown error.

       

      I was running Workstation Pro 12.5, so I decide to upgrade to 14.1.1, same problem.

      I tried on the Player 14, same problem... BUT, once, only once it work and I was able to see the device in Configurator and apply the profile that I needed.

      I also have a WinXP and a Win7 VM, and they can connect to the iphone8, so look like it's not an issue with the host/vmware application...

       

      VMTools is up to date

      Set to USB 2.0,

      Use the PC USB 2.0 or 3.0 port, with or without a USB hub (all those options work with the iphone 6/6s)

      The "usb.quirks.device0 = "0xvid:0xpid" config been tested and not working

      I delete all the files in c:\users\vmware\...

      I tested a new fresh guest machine from scratch, same result (so I can get narrow out a faulty .vmx file)

       

      The result is always the same... loop reconnect/disconnect on the guest machine, I hear the "dong" sound on Win7 when usb device is connect looping with the idevice sound when it connect...

       

      This is the log file for the iphone6s with the connection working

       

      2018-02-13T18:54:01.302-05:00| vmx| I125: USB: Found device [name:Apple\ iPhone vid:05ac pid:12a8 path:1/9/0/9/2/3 speed:high family:vendor,audio,hid,imaging virtPath:ehci:0 instanceId:USB\\VID_0E0F&PID_0001\\xxx serialnum:xxx arbRuntimeKey:6 quirks:slow-reconnect ownerdisplay:OS\ 10.13.2\ High\ Sierra version:3], connected to ehci port 0.

       

       

      2018-02-13T18:54:01.302-05:00| vmx| I125: USB: Device [name:Apple\ iPhone vid:05ac pid:12a8 path:1/9/0/9/2/3 speed:high family:vendor,audio,hid,imaging virtPath:ehci:0 instanceId:USB\\VID_0E0F&PID_0001\\xxx serialnum:xxx arbRuntimeKey:6 quirks:slow-reconnect ownerdisplay:OS\ 10.13.2\ High\ Sierra version:3] should already be connected

       

       

      And this is the iPhone8+ that doesn't work

       

      2018-02-13T19:23:39.465-05:00| vmx| I125: USB: Found device [name:Apple\ iPhone vid:05ac pid:12a8 path:1/9/0/9/2/3 speed:high family:vendor,audio,hid,imaging virtPath:ehci:0 instanceId:USB\\VID_0E0F&PID_0001\\xxx serialnum:xxx disconnected:1 arbRuntimeKey:8 quirks:slow-reconnect ownerdisplay:OS\ 10.13.2\ High\ Sierra version:3], connected to ehci port 0.

       

       

      2018-02-13T19:23:39.465-05:00| vmx| I125: USB: Device [name:Apple\ iPhone vid:05ac pid:12a8 path:1/9/0/9/2/3 speed:high family:vendor,audio,hid,imaging virtPath:ehci:0 instanceId:USB\\VID_0E0F&PID_0001\\xxx serialnum:xxx disconnected:1 arbRuntimeKey:8 quirks:slow-reconnect ownerdisplay:OS\ 10.13.2\ High\ Sierra version:3] should already be connected

       

      I highlighted the only difference between both.

       

      Any clue why ??

       

      My next project will be to test it on another PC in the office, fresh Workstation installation.

       

      Thanks

    • By carloslockward
      Hello,
       
      Im trying to install macOS Sierra on a Virtual Machine using VMware on my AMD desktop, however there is no current support for such a machine using those prebuilt virtual disks that are all over the Internet. But i looked up and find that Bronya made a kernel patch for AMD processors(Still in beta), does anyone know how can i use this patched kernel on a Virtual machine?  
       
      Patched Kernels for Sierra: http://wiki.osx86project.org/wiki/index.php/Patched_Kernels#macOS_10.12_Sierra 
       
      Thanks!
×