How to add a remote image to a specific row

Hello together,
I try to build a table like that one from the AppStore.
What I did was to create my own UITableViewCell and defined the space for images and text.
Now I call this in the "cellForRowAtIndexPath" method.
The Problem is, that I have to download the images from the web.
So I threaded it that the table will not block (threadForImageLoading-method)
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
DetailCell *cell = (DetailCell *)[tableView dequeueReusableCellWithIdentifier:@"DetailCell"];
if (cell == nil) {
cell = [[[DetailCell alloc] initWithFrame:CGRectZero reuseIdentifier:@"DetailCell"] autorelease];
NSString *editString = [resultsArray objectAtIndex:indexPath.row];
NSRange start = [editString rangeOfString:@" ["];
NSString *place = [editString substringToIndex:start.location];
NSString *dist = [editString substringFromIndex:start.location + 2];
cell.distance.text = dist;
cell.description.text = place;
[NSThread detachNewThreadSelector:@selector(threadForImageLoading:) toTarget:self withObject:cell];
return cell;
- (void) threadForImageLoading:(DetailCell *) tableCell
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSData * imageLink;
imageLink = [[NSData alloc] initWithContentsOfURL:[NSURL URLWithString:@"http://upload.wikimedia.org/wikipedia/commons/thumb/7/7d/Californiablank_map.svg/298px-California_blankmap.svg.png"]];
tableCell.imageFace.image = [UIImage imageWithData:imageLink];
tableCell.contentMode = UIViewContentModeScaleAspectFill;
[imageLink release];
[pool release];
I test it here with an fixed URL-String because I do not know how I can put more that one parameters to my method "threadForImageLoading". In my opinion I just can use one parameter ("withObject:").
This cannot be but unfortunately I didn`t find the right usage to use more than one parameter.
But the main question is: Is it enough to have the "tableCell" in the threadForImageLoading-method that every picture is placed at the correct row?
Thanks alot for helping,
Stephan

TRY THIS
GraphicConverter

Similar Messages

  • How to add tooltip to images?

    How to add tooltips to images?

    OK, here is a more robust, more generic (any node) implementation.
    It would be nice if I could find a way to automatically insert the tooltips in the scene, but at time of node with tooltip creation, scene doesn't exist yet... Should have a post-layout event, perhaps. Or I can do that once on the onMouseEntered event, but then I have to find a way to get the scene holding a given node. Tried to iterate on Parents, but I can't cast a Parent to a Scene?
    Anyway, here is the new code:
    Tooltip.fx
    public class Tooltip extends CustomNode
      public var text: String;
      public var fill: Paint = Color.web('#EEFF00');
      public var stroke: Paint = Color.GREEN;
      var label: Label; // Make public to access textOverrun, textWrap, etc.?
      var back: Rectangle;
      override function create(): Node
        label = Label
          text: text
        back = Rectangle
          x: -2, y: -1
          width:  label.width + 4
          height: label.height + 2
          fill:   fill
          stroke: stroke
        Group
          content: [ back, label ]
      init
        visible = false;
        layoutInfo.managed = false;
    WithTooltip.fx
    public mixin class WithTooltip
      /** The tooltip to display. */
      public var tooltip: Tooltip;
      // We display the tooltip after a while being over the node
      var tooltipTL = Timeline
        keyFrames: KeyFrame
          time: 750ms
          action: function ()
    //~         println("visible {%.0f tooltip.boundsInParent.minX} {%.0f tooltip.boundsInParent.minY}");
            tooltip.visible = true;
      var baseMouseMoved;
      var baseMouseEntered;
      var baseMouseExited;
      postinit
        var tooltipNode = this as Node;
        baseMouseMoved = tooltipNode.onMouseMoved;
        tooltipNode.onMouseMoved = function (evt: MouseEvent): Void
          if (not tooltip.visible)
            tooltip.translateX = evt.sceneX;
            tooltip.translateY = evt.sceneY - 20;
          baseMouseMoved(evt);
        baseMouseEntered = tooltipNode.onMouseEntered;
        tooltipNode.onMouseEntered = function (evt: MouseEvent): Void
    //~       println("onMouseEntered: {%.0f evt.sceneX} {%.0f evt.sceneY}");
          tooltipTL.playFromStart();
          baseMouseEntered(evt);
        baseMouseExited = tooltipNode.onMouseExited;
        tooltipNode.onMouseExited = function (evt: MouseEvent): Void
    //~       println("onMouseExited");
          tooltipTL.stop();
          tooltip.visible = false;
          baseMouseExited(evt);
    SomeStage.fx
    class ImageWithTooltip extends ImageView, WithTooltip
    var earthTT = Tooltip { text: "Mother Earth" }
    var earth = ImageWithTooltip
         image: Image { url: "{__DIR__}earth.png" }
         tooltip: earthTT;
    var mapTT = Tooltip { text: "General map of France" }
    var map = ImageWithTooltip
         image: Image { url: "{__DIR__}map.jpg", width: 200, preserveRatio: true }
         tooltip: mapTT;
    // Put the ImageWithTooltip nodes in layout if needed, put the Tooltip nodes at the end of the scene (on top, out of any layout).

  • How to add a new excel sheet  when the row count exceed more than 65 k

    am working on business intellignence am able to export the data to excel sheet but my data exceeds the sheet limit so how to add to another sheet when the last row is hit ..???
    any suggestions warm welcome...
    help me to fix this issue...

    You've not specified how you're generating the Excel file. Are you using POI? JExcel? What?
    People on the forum help others voluntarily, it's not their job.
    Help them help you.
    Learn how to ask questions first: http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch
    (Yes I know it's on JavaRanch but I think it applies everywhere)
    ----------------------------------------------------------------

  • HOW TO ADD TEXT TO IMAGES

    how do you add text to images in Aperture?

    the user can superimpose text (inc. metadata) anywhere: on the image, in the border, over both.
    Learn something new every single day...
    Regards
    TD

  • How to add audio to image sequence?

    I've imported a Photoshop image sequence into FCP X 10.1.1.  Dropped it on the timeline, created a compound clip.  So far I can't figure out how to add audio of any kind.  I've tried starting over, making sure properties had audio setting enabled.  No change though.  No matter what I try, no audio tab in the inspector.  What am I missing?
    Thanks,
    Michael

    Are you importing an audio file that is seperate? Otherwise it is attached to your video. in the timeline, choose expand audio & video. You can import almost any format. Import it into the same event that you are in - a song from your desktop or from your folder where you copied all your contents from your camera card or music from ITunes (in which case you use the audio tab on the far right of the timeline UNDER THE INSPECTOR).
    How did you import your media?:
    Help?

  • Original iMac G5 now running Leopard - How to add Apple Remote?

    I'd like to use my iMac G5 to run Front Row and play music and movies through my HDTV. I'm already connected to the TV, so that's not an issue.
    How do I add an Apple Remote to this, for use with Front Row? I know I can use the wireless keyboard to control it, but the WAF (wife acceptance factor) for that solution is low. All the new Macs have built in IR, but not this first gen model, so I'm not sure how to do this. (I think I could add a third party remote like the KeySpan, but I'd rather use the Apple Remote if possible.)
    (I did see this thread: http://discussions.apple.com/thread.jspa?messageID=7384584 , but it doesn't exactly address my wish for the Apple Remote)
    While we're on the topic, my HDTV is being used as a second monitor. Works well for displaying videos and such in iTunes and from various other sources. How does this work with FrontRow, though? (The displays are NOT mirrored.) Does it show on both screens, or is there a way to force it to show on one display or the other?

    How does this work with FrontRow, though?
    Front Row will only display on the "main" monitor. That is, the monitor that's showing the Dock and menubar. You will probably need to use the Displays System Preferences to change the main display to the HDTV.
    -Doug

  • How to add two different images on photoshop cs5?

    I was learning about the layers and masks and i seen that i have to have two images under each others under the layer option pannel, i tried many times to add images but it always shows in two different pannels as the folloing image I want to add two different images in this pannel to make any changes i want
    Thank you.
    image

    When you click on that icon Photoshop will add a revail all white layer mask and it will be the Photoshop target. Begin painting with black over the image part you wish to hide. Should you paint away something you want change to white paint and paint it back. Lower the brush opacity to fade in and out the image part.
    If you use ALT+Click on that icon a hide all black layer mask will be added as the current taget and hide all of the layer paint with whits to show.

  • How to add styles to image in XML view ?

    Is it possible to add styles to Images in XML view ?
    <Image alt="alternate text " src = " " />
    I tried adding sytle= "align : right " but its not working. I just want to align this element in the view to the right.

    Hi Micheal,
    Pleas see the below code.
    View:
    <core:View xmlns:core="sap.ui.core" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m"
      controllerName="testing.imageXml" xmlns:html="http://www.w3.org/1999/xhtml">
      <Page title="Image">
      <content>
      <Image id="img1" alt="alttextimage" src="images/img1.jpg" />
      </content>
      </Page>
    </core:View>
    Controller:
    onBeforeRendering: function() {
      this.getView().byId("img1").addStyleClass("myimage");
    Index.html :
    <!DOCTYPE HTML>
    <html>
      <head>
      <meta http-equiv="X-UA-Compatible" content="IE=edge">
      <meta http-equiv='Content-Type' content='text/html;charset=UTF-8'/>
      <script src="resources/sap-ui-core.js"
      id="sap-ui-bootstrap"
      data-sap-ui-libs="sap.m,sap.ui.commons"
      data-sap-ui-theme="sap_bluecrystal">
      </script>
      <script>
      sap.ui.localResources("testing");
      var app = new sap.m.App({initialPage:"idhome1"});
      var page = sap.ui.view({id:"idhome1", viewName:"testing.imageXml", type:sap.ui.core.mvc.ViewType.XML});
      app.addPage(page);
      app.placeAt("content");
      </script>
      <style>
      .myimage{float:right !important; width:300px; height:200px;}
      </style>
      </head>
      <body class="sapUiBody" role="application">
      <div id="content"></div>
      </body>
    </html>
    Output :
    Regards,
    KK

  • How do i display remote images in an email saved as a .eml file?

    I archive my messages in a CMS in the .eml format. Most of these messages have links to remote images. When I open the .eml file, the images do not display, and I cannot find an option to display them.

    Go to this discussion: https://discussions.apple.com/message/15854997#15854997

  • How to add, JS and image files in portalapp.xml

    Hi All,
    I was trying to implement multiple level hover detailed navigation in iview for which I got couple of css scripts from web which include javascripts.
    I placed these files in respective folders and their reference in header.jsp but when the iview is rendered in browser the reference is changing to .htm
    So please help me out how to place these script / image files in PAR file and their reference in portalapp.xml & header.jsp.
    Thanks in advance,
    Sai Krishna.

    1) The CSS file you have , save as "jsp" file and please place in the jsp folder.
    suppose your jsp is header.jsp and your css file is header_style.jsp
    include the css jsp - header_style.jsp in header.jsp like
    <%-- an include clause for css file --%>
    <%@ include file="header_style.jsp" %>
    2) All your images , please place in the "images" folder.
    3) To access the images use like below: in CSS file (jsp)
    in header_style.jsp
    yourimage: url(<%=mimeUrl%>/images/Border.gif);
    in header.jsp
    <%
    String mimeUrl = componentRequest.getWebResourcePath();
    %>
    4) more info for creating the hover menu read this blog
    https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/4913
    Hope this will help you.

  • How to get info who is locking a specific row in the RDBMS 9i?

    Hi,
    could some one please helop me with this? I would like to know the Oracle user name of the user who is locking a specific row in my table. I can display all locking requests with the following SQL statements. What I could not igure out how to find the rownum that is being locked by others?
    SELECT *
    FROM v$lock lk, v$session s , DBA_OBJECTS ao, wf_users wu
    WHERE lk.lmode > 1
    AND s.username IS NOT NULL
    AND lk.SID = s.SID
    AND ao.OBJECT_ID(+) = lk.id1
    AND s.username = wu.NAME(+)
    AND ao.owner = USER
    AND ao.object_name = 'BWF_IKTATASI_ADATLAPOK';
    Thank you in advance,
    Tamas Szecsy

    I'm not sure what's happening with your app. I wrote on up to see if it could handle the CTRL-C. Seems to work fine. Do you have any other JMenuItems with the same accelerator?
    import java.awt.event.*;
    import javax.swing.*;
    public class Copy extends JFrame {
         public Copy() {
              this.initMenuBar();
              this.setSize(400, 300);
              this.setVisible(true);
              this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         private void initMenuBar() {
              JMenuBar menubar = new JMenuBar();
              JMenu edit = new JMenu("Edit");
              JMenuItem copy = new JMenuItem(new CopyAction("Copy"));
              edit.setMnemonic(KeyEvent.VK_E);
              copy.setMnemonic(KeyEvent.VK_C);
              copy.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, InputEvent.CTRL_MASK));
              edit.add(copy);
              menubar.add(edit);
              this.setJMenuBar(menubar);
         public static void main(String[] args) {
              new Copy();
         private class CopyAction extends AbstractAction {
              public CopyAction(String label) {
                   super(label);
              public void actionPerformed(ActionEvent e) {
                   System.out.println("Action Performed.");
    }

  • How to add link and image in oaf iprocurement stores page?

    Hi Every1,
    I have requirement to in iprocurement stores page. Already there are certain links ( a meaning full image+link ), by click on image or link it will take you to the
    required page.
    I need to add one more like that.
    How can i do this ?
    I know thru personalizations we can add links to the page, but how can i add image to that link. so that click of anyone will take to the req page.
    Thanks,
    Arun Peddi

    Hi,
    Here is one way of putting an image in the header:
    <fo:layout-master-set>
        <fo:simple-page-master master-name="my-page">     
          <fo:region-body margin="1in"/>
          <fo:region-before extent="1in" background-color="silver" />
        </fo:simple-page-master>
      </fo:layout-master-set>
      <fo:page-sequence master-reference="my-page">
         <fo:static-content flow-name="xsl-region-before">
             <fo:block height="150px" width="1024px" background-color="white" >
                 <fo:external-graphic src="http://localhost:9000/web-determinations9000/images/Header.jpg">
                 </fo:external-graphic>
            </fo:block>
        </fo:static-content>
        <fo:flow flow-name="xsl-region-body">
        </fo:flow>
      </fo:page-sequence>One good XSL:FO refernce: http://www.learn-xsl-fo-tutorial.com
    Hope this helps.
    Thanks,
    Aakarsh
    Edited by: aakarsh on Apr 6, 2011 6:40 AM

  • How to add a file (image) to a saved book?

    I saved my book in LR.
    It shows up as a collection.
    How can I add an image to it?
    The folder from where I made the book doesn't show the created book anymore.

    Very simple solution:
    In Library module R-click on the book collection in question - a dialog box opens, select 'Set as Target Collection'.
    A '+' sign will then become visible next to the name of that collection.
    Then find the image that you want to add to that book and select it by clicking on it.
    Press 'B' as a shortcut to add that image to the collection.
    You are done!
    Tony Jay

  • Spry Photo Gallery - How to add links to images

    I was wondering if any one knew how I could add individual
    links to images on the spry Photo Gallery—An XML-based photo
    gallery. I need each image to have its own individual link when
    clicked on. Any assistance would be most helpful.

    Hi,
    In the dashboard --> edit option u can see dashboard object here u can see folder ...by this folder u just include dashboard page other wise in the catalog share folder u need create each and evry module pre planned folder then save it each dashboard pages to relevent module folder.
    THanks
    Deva

  • How to add a 3D image / layer to a flat image

    I'm new to 3D and have been given an assignment to add a 3D object to the flat image of a building facade. The building is a three story medical centre and the 3D object needs to demonstrate what a new elevator with advertising on three sides would potentially look like.
    Any suggestions or help in this regard would be greatly appreciated.
    I was trying to do this with CS4 extended, but have downloaded the CS6 Extended Trial version, if this can be done in CS6 then I can motivate to purchase the upgrade.
    Thanks
    Robin

    The elevator is nothing more than a box. So your job is quite easy in that you have the choice of using a true 3d object or fake it by skewing the 2d objects until it looks like it is a 3d box.
    Either way applying textures to a 3d object or clipping an image to the 2d object will result in the same illusion.
    Its up to you to decide on how much detail is needed and what will you need to learn to get that result. If you go the extra step and go the 3d route, you will find that the end result is much quicker minus the learning curve because it is much easier to align object to make it look correct.
    CS6's 3d tools now include extrusion so the handle for the elevator is easier to create since it starts with a 2d ellipse.
    Where you will have trouble is the mounts for the handle. Because photoshop does not have a way to manipulate the mesh to form it's shape.
    This can be done using a 3rd party app. There are some free ones available on the net. The most popular for free at the moment is Blender. It will do anything you need for your project. Including esporting it as an obj file which can then be imported into photoshop.
    If all you need is a box with the ads on the inside then photoshop CS6 can do it. Just slice the front so it does not show then replace the textures for each side. Done.

Maybe you are looking for