Search Results

Search found 4 results on 1 pages for 'rustyshelf'.

Page 1/1 | 1 

  • Correct way to load image into UIWebView from NSData object

    - by rustyshelf
    I have downloaded a gif image into an NSData object (I've checked the contents of the NSData object and it's definitely populated). Now I want to load that image into my UIWebView. I've tried the following: [webView loadData:imageData MIMEType:@"image/gif" textEncodingName:nil baseURL:nil]; but I get a blank UIWebView. Loading the image from the same URL directly works fine: NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:imageUrl]]; [imageView loadRequest:request]; Do I need to set the textEncodingName to something, or am I doing something else wrong? I want to load the image manually so I can report progress to the user, but it's an animated gif, so when it's done I want to show it in a UIWebView. Edit: Perhaps I need to wrap my image in HTML somehow? Is there a way to do this without having to save it to disk?

    Read the article

  • NSDateFormatter, am I doing something wrong or is this a bug?

    - by rustyshelf
    I'm trying to print out the date in a certain format: NSDate *today = [[NSDate alloc] init]; NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateFormat:@"yyyyMMddHHmmss"]; NSString *dateStr = [dateFormatter stringFromDate:today]; If the iPhone is set to 24 hour time, this works fine, if on the other hand the user has set it to 24 hour time, then back to AM/PM (it works fine until you toggle this setting) then it appends the AM/PM on the end even though I didn't ask for it: 20080927030337 PM Am I doing something wrong or is this a bug with firmware 2.1? Edit 1: Made description clearer Edit 2 workaround: It turns out this is a bug, to fix it I set the AM and PM characters to "": [dateFormatter setAMSymbol:@""]; [dateFormatter setPMSymbol:@""];

    Read the article

  • Is there an easy way to make a horizontally paged UIScrollView wrap around?

    - by rustyshelf
    I notice that in the stocks application, the small graph wraps around, eg: when you get to the end of the scroll view and swipe right again, you go back to the beginning. Before I go ahead and code this myself is there an easy way to do this in the SDK? I can't find any properties or methods that would enable that? I have a paged UIScrollView that scrolls horizontally, pretty much exactly like the stocks application one does.

    Read the article

  • How To Configure Query Cacheing in EclipseLink

    - by rustyshelf
    I have a collection of states, that I want to cache for the life of the application, preferably after it is called for the first time. I'm using EclipseLink as my persistence provider. In my EJB3 entity I have the following code: @Cache @NamedQueries({ @NamedQuery( name = "State.findAll", query = "SELECT s FROM State s", hints = { @QueryHint(name=QueryHints.CACHE_USAGE, value=CacheUsage.CheckCacheThenDatabase), @QueryHint(name=QueryHints.READ_ONLY, value=HintValues.TRUE) } ) }) This doesn't seem to do anything though, if I monitor the SQL queries going to MySQL it still does a select each time my Session Bean uses this NamedQuery. What is the correct way to configure this query so that it is only ever read once from the database, preferably across all sessions? Edit: I am calling the query like this: Query query = em.createNamedQuery("State.findAll"); List<State> states = query.getResultList();

    Read the article

1