Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
perhaps the images aren't readily available? are they programatically created?

i only really want to change the track images on my slider, but when change them, the standard thumb disappears (annoying!), so i have to supply a thumb as well.

any ideas?
 
alright... seems to be a mystery... no better time than to break out the old Illustrator, i guess :rolleyes:

so, if anyone ever finds themselves in my position, my attempt to emulate the default thumb is attached. please help yourselves.
 

Attachments

  • UISliderThumb33x33.png
    UISliderThumb33x33.png
    4.3 KB · Views: 1,803
i can't seem to extract the UIKit artwork. following the topic on this blog doesn't help.

i've created a view-based app, pasted that code in the view controller implementation, and set it to activate the action with viewDidLoad:

Code:
#import <UIKit/UIKit.h>

@interface _ViewController : UIViewController {

}
- (IBAction)extractArtwork:(id)sender;
@end
Code:
#import <mach-o/dyld.h>
#import <mach-o/nlist.h>
#import "_ViewController.h"

@implementation _ViewController



extern UIImage *_UIImageWithName(NSString *);
 
- (NSMutableDictionary*) UIKitImages
{
    NSMutableDictionary *mappedImages = nil;
 
    for(uint32_t i = 0; i < _dyld_image_count(); i++) {
        if (strstr(_dyld_get_image_name(i), "UIKit.framework")) {
            struct nlist symlist[] = {{"___mappedImages", 0, 0, 0, 0}, NULL};
            if (nlist(_dyld_get_image_name(i), symlist) == 0 && symlist[0].n_value != 0) {
                mappedImages = (NSMutableDictionary*)*(int*)symlist[0].n_value;
            }
            break;
        }
    }
 
    return mappedImages;
}
 
- (IBAction) extractArtwork:(id)sender
{NSLog(@"extracting...");
    for (NSString *imageName in [[self UIKitImages] allKeys]) {
        NSString *documentsPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
        NSString *imagePath = [documentsPath stringByAppendingPathComponent:imageName];
        [UIImagePNGRepresentation(_UIImageWithName(imageName)) writeToFile:imagePath atomically:YES];
    }
}


- (void)viewDidLoad {
[self extractArtwork:nil];
    [super viewDidLoad];
}

@end

nothing happens. the method is executed as i can see the "extracting..." NSLog in the console, but no images are written to my documents folder.
 
It worked for me. What version of the Sim OS are you running under. What happens if you NSLog the imageAddress?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.