Blog Archives

Time to Throw Away Your iTunes

Everyone who has a iPhone or iPod is using itunes definitely. However, does everyone like it? Does everyone think it is convenient? Does everyone really want to use it if they have a substitute that is more easier to use and can do much more for your iPhone and iPod? I think everyone wants to replace it because it has too many limitations and it serves apple but not people who has a iPhone or iPod. Now it is the time to throw away your itunes. Because you have this iPhone transfer and iPod transfer.

This powerful iPhone Transfer can help you to import songs/videos/images from your computer to iPhone. It can also backup your iPhone music/videos/images to your computer or external hard dirve. Most important, it can help you to put your DVD movies and videos/movies you download from internet and the format is not supported by iPhone to iPhone easily. It can also help you to make iPhone rigntones for iPhone users from video/dvd/music they have.
OK, only from what I said you may not fall in love with it immediately. Let’s see how it works for you.

Part 1: How to Import DVD Movies/Videos/Songs/Images to iPhone
Step 1: Connect iPhone

Plug your iPhone to your computer via USB cable, it can automatically find your iPhone, load your iPhone info and show the info at the left of its interface. (It works the same as itunes.)

Step 2: Import to iPhone
A. Import DVD movies to iPhone (iTunes does not allow you to do this)

1.Select “Movie” in the left list and then click “PC to iPhone” button at the bottom of the interface, you will see a conversion and import window.
2.Put your DVD movies in your DVD Drive and Click “Load DVD” button to load the movies.
3.You can choose “Audio track” and “Subtitles” of the output movies, if you do not want a subtitle just leave it blank. You need also select the output profile and you can select apply to all button to use this output profile forever, if you do not use it some day, you can change it at will.
4.Click “Import” button and it will help you to convert the movies to iPhone video format and then import into your iPhone directly.

Note:
You need to check the box before “convert files before importing”, if not the movies/videos/songs can not be recognized by iPhone and can not be played in iPhone.

B. Import videos/songs to iPhone (iTunes only import certain format videos/songs to iPhone)

1. Select “Video” or “Music” in the left list and then click “PC to iPhone” button and go to the conversion and import window
2. Click “Add File” button to add the video or music to it and you can choose output profile and then click “import” button
Note:
If the videos and songs’ format is not supported by iPhone, this powerful iPhone transfer will convert them first and then transfer them into your iPhone. If you have lots of videos or songs it may take longer to transfer them to your iPhone.

C. Import photo/images to iPhone
The process of importing images to iPhone is the same as videos/songs. First you need to select photo in the left list. Second you can select photos to import to your iPhone.

Using entire iphone screen

Hi people,

I have succefully removed the Navigation Bar from a view in an application made using "Navigation Bar Template" but I would use the entire scrren covering also the br with "clock, battery status, signal strength", how can I do this?

Thaks a lot

Parsing XML without attribute and display it in UITableView

Hello all, I’m newbie in iPhone Application Programming. I can’t get value from XML file and display it in UITableView. I need to get the name value of animal. How is the simple way to parse XML without attribute? I’ve been read NSXMLParser Documentation but the data is not displayed in my UITableView. Here is my XML file :

Code:

<?xml version="1.0" encoding="UTF-8"?>
<animals>
  <animal>
    <id>1</id>
    <name>Elephant</name>
  </animal>
  <animal>
    <id>2</id>
    <name>Tiger</name>
  </animal>
  <animal>
    <id>3</id>
    <name>Bird</name>
  </animal>
</animals>


I follow some tutorial about Parsing XML with attribute, but in my XML file, I don’t have attribute. And this is my code to parse XML:

Code:

- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName
      namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName
    attributes:(NSDictionary *)attributeDict {

    if([elementName isEqualToString:@"animals"]) {
        appDelegate.animals = [[NSMutableArray alloc] init];
    }

    else if([elementName isEqualToString:@"animal"]) { 
    }

    else if([elementName isEqualToString:@"id"]){
        aAnimal = [[Animal alloc] init];
        aAnimal.animalID = elementName;
    }
}

- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string {
    if(!currentElementValue)
        currentElementValue = [[NSMutableString alloc] initWithString:string];
    else
        [currentElementValue appendString:string];
}

- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName
      namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName {

    if([elementName isEqualToString:@"animals"])
        return;
    else if([elementName isEqualToString:@"animal"]) {
    }
    else if([elementName isEqualToString:@"id"]) {
        [appDelegate.animals addObject:aAnimal];     
        [aAnimal release];
        aAnimal = nil;
    }
    else
        [aAnimal setValue:currentElementValue forKey:elementName];

    [currentElementValue release];
    currentElementValue = nil;
}


Name of user making in app purchase payment?

I’m using In App Purchases in my application and I need the firstname and lastname of the user that bought the stuff. Can I in some way get this from the user when he makes the payment? It should be so easy as otherwise I need the user to enter this info again (he already entered it to Apple).

Need HELP with inAppPurchase, I’m really stuck!

Hi there!

I’m trying to get InApp Purchase working in my app and, unfortunately, I’m still not able to do this…
I’ve followed the steps in this thread:

www.iphonedevsdk.com/forum/ip…-purchase.html

I have a productID (which is a number, like 10324), an AppID (which is an alphanumeric, like HDH535G6G.com.company), some test users, and I’ve copied the code in my app (and yes, I’ve already disconnected from my own iTunes account, and I’m testing on a 3.0 OS device).

I’ve included some logs in the buying process, and I have the following code (split in my app’s main process, which is an EAGLView class, and the CustomStoreObserver):

Code:

// EAGLView.m class:
- (void) purchaseGame
{
        /*
        SKPayment *payment = [SKPayment paymentWithProductIdentifier:kMyFeatureIdentifier];
        [[SKPaymentQueue defaultQueue] addPayment:payment];
        */

        if ([SKPaymentQueue canMakePayments])
        {
                // Display a store to the user.
                CustomStoreObserver *observer = [[CustomStoreObserver alloc] init];
                [[SKPaymentQueue defaultQueue] addTransactionObserver:observer];
                SKPayment *payment = [SKPayment paymentWithProductIdentifier:kMyProdId];
                [[SKPaymentQueue defaultQueue] addPayment:payment];
                [self showLoading];
                NSLog(@"Stores enabled!");
        }
        else
        {
                // Warn the user that purchases are disabled.
                NSLog(@"Stores disabled!");
        }
       
}

- (void) requestProductData
{
        SKProductsRequest *request= [[SKProductsRequest alloc] initWithProductIdentifiers: [NSSet setWithObject: kMyProdId]];
        request.delegate = self;
        [request start];
}

- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response
{
        NSArray *myProduct = response.products;
        // populate UI
        for(int i=0;i<[myProduct count];i++)
        {
                SKProduct *product = [myProduct objectAtIndex:i];
                NSLog(@"Name: %@ - Price: %f",[product localizedTitle],[[product price] doubleValue]);
                NSLog(@"Product identifier: %@", [product productIdentifier]);
        }
}


Code:

// CustomStoreObserver.m class:
@implementation CustomStoreObserver

- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions
{
    for (SKPaymentTransaction *transaction in transactions)
    {
                NSLog(@"Trans: %@",[transaction transactionIdentifier]);
                NSLog(@"prodId: %@",[[transaction payment] productIdentifier]);
                NSLog(@"qtt: %d",[[transaction payment] quantity]);
        switch (transaction.transactionState)
        {
            case SKPaymentTransactionStatePurchased:
                [self completeTransaction:transaction];
                break;
            case SKPaymentTransactionStateFailed:
                [self failedTransaction:transaction];
                break;
            case SKPaymentTransactionStateRestored:
                [self restoreTransaction:transaction];
            default:
                break;
        }
    }
}

- (void) failedTransaction: (SKPaymentTransaction *)transaction
{
        if (transaction.error.code != SKErrorPaymentCancelled)
        {
                // Optionally, display an error here.
        }
        [[SKPaymentQueue defaultQueue] finishTransaction: transaction];
        NSLog(@"Transaction failed!");
}

- (void) restoreTransaction: (SKPaymentTransaction *)transaction
{
        //If you want to save the transaction
        // [self recordTransaction: transaction];
       
        //Provide the new content
        // [self provideContent: transaction.originalTransaction.payment.productIdentifier];
       
        //Finish the transaction
        [[SKPaymentQueue defaultQueue] finishTransaction: transaction];
        NSLog(@"Transaction restored!");
       
}

- (void) completeTransaction: (SKPaymentTransaction *)transaction
{
        //If you want to save the transaction
        // [self recordTransaction: transaction];
       
        //Provide the new content
        //[self provideContent: transaction.payment.productIdentifier];
       
        [[SKPaymentQueue defaultQueue] finishTransaction: transaction];
        NSLog(@"Transaction complete!");
       
}

@end


When I touch the buy button I get the following on the console):

Code:

...[292:207] PURCHASE FULL VERSION!
...[292:207] Trans: (null)
...[292:207] prodId: 10324
...[292:207] qtt: 1
...[292:207] Stores enabled!


And, after a few seconds, what I get it:

Code:

...[292:207] Trans: C8A30EE5-C7D0-410B-A0FE-AE8D90EAEB66
...[292:207] prodId: 10324
...[292:207] qtt: 1
...[292:207] Transaction failed!


What can be happening? I’ve also tried changing my prodID by the alphanumeric one and the result is the same, anyone have the clue about this? Any help will be REALLY appreciated!

Thanks!

Blue “done style” UIButton

After searching high and low and not finding these images anywhere I tried to create them and put them online in case it might save anyone else some time:

Blue button images for iPhone app

Share an all-in-one Video Converter for Mac OS X

More and more multimedia tools are available for the Mac users, and sometimes it is really hard to choose the proper one that can meet our need. Now I’d like to share a powerful, easy-to-use and full-featured Video Converter for Mac OS X—4Easysoft Mac Video Converter.
With it, you can convert General Video such as FLV, WMV, AIV, 3GP, MP4 and HD video such as TOD, MOD, TS, M2TS, MTS, MOV…; extract audio from your videos to MP3, MP2, AAC, OGG, WMA, FLAC and more like a Video to Audio Converter; and edit your videos by functions of Edit, Trim, Crop, Merge several video files into a single file.

The following are the detailed guide about it:
Preparation: Download and install 4Easysoft Mac Video Converter

Step 1:Click “Add File” button, you can add the files that you want to convert.
This converter can convert all sorts of videos, including General Videos (FLV, WMV. SWF, MP4, RM, RMVB, AVI, 3GP, etc. ) and HD videos (TOD, MOD, M2TS, MTS, TS, MP4, MOV, RM…) to diverse players, like iPod, iPhone, iPhone OS 3.0, PSP, Zune, Creative Zen, Wii, even Gphone and etc…
Step 2:Set output settings.
From the profile drop-down list, you can choose the output format you want.
Click the “Browse” you can choose the output destination.
Click “setting” button, a windows pops up and you can change the Encoder, Resolution, Frame Rate, Bitrate of video as well as Encoder, Sample Rate, Channels, and Bitrate of audio

Step 3:Click “Start” button to begin the conversion.

Editing Tips:
You can edit your videos by using this converter, such as:
1. Effect—adjust your video brightness, saturation and contrast according your preference
2. Trim—get any part of your video to convert
3. Crop—get your players suitable play region video

4. Merge—enjoy a long video from several clips
5. Snapshot—capture any image you like in the videos

For Windows users, you can try Total Video Converter which can convert between any two video formats such as MP4 to MP3, Mod to AVI, etc
Try now! Hope this can not let you down!

How can I update the events in the interface(mainthread) from the background thread?

1.My mainView is a UIScrollView. I have to load 9 images as tiles onto it.

2.I am calling the function as a different thread to get the 9images and to load it into the interface(mainthread). By doing so, the interface remains responsive.

3.But the problem even when the images are being loaded they doesnt get displayed in the UIScrollView until the whole thread is completed. But if I am doing some action on the interface, I am able to see each of them being loaded and displayed.

4. Means I have to update the interface(mainthread) from the background thread after each image is being loaded into it.

How can i do it? I have given the code which I use to load the images to the UIScrollView which i call using a different thread.

Code:

- (void)setUpDisplay:(NSArray *)array
{
NSAutoreleasePool *pool=[[NSAutoreleasePool alloc] init];

myScrollView.userInteractionEnabled = YES;
myScrollView.multipleTouchEnabled = YES;

int x=0,y=0;
CGRect frame;
for (i = 0; i < 3; i++)
{
    if(j == 3)
    {
        x=x+256;
        y = y-768;
    }
    for (j = 0; j < 3; j++) {
        imageView = [[UIImageView alloc] initWithImage:[self getCachedImage:[NSString stringWithFormat:@"url to fetch images"]]];
        frame = [imageView frame];
        frame.origin.x = x;
        frame.origin.y = y;
        [imageView setFrame:frame];
        imageView.userInteractionEnabled = YES;
        imageView.multipleTouchEnabled = YES;
        [myScrollView addSubview:imageView];
        y = y+256;

        [imageView release];
        imageView=nil;
    }
}

[pool release];


UIWebView not loading until refresh button is pressed?

Not sure what my issue is here. When the view is loaded, it displays properly, but the UIWebView doesn’t load. Until I hit the refresh button.

The app uses a few different views.This view should open and load a UIWebView when the view is opened. Instead, it just opens to the view, and the webview doesn’t load. As soon as the refresh button is hit, the activity indicator starts spinning, the site loads, then it disappears; leaving the loaded site ready to use.

What can I use to call the load request as soon as the view is opened?

How to avoid CALayer leaks?

Hi there!

I’m working on an OpenGL game and finishing memory optimization by solving any existing leak caused by OpenGL’s mallocs or proper objects allocations. But now I’ve found that there are some allocations that keep increasing while the game is running… They are not so important because are 56 Bytes mallocs, but after playing some time memory becomes higher that it should do, so I want to solve this too. What I’ve found is that allocations doesn’t come from any own object or any OpenGL method (related with textures), they come from QuartzCore! Tracking with Instruments I’ve found that there are lots of that kind:

Code:

Malloc 56 Bytes - Resp. Library: QuartzCore - Resp. Frame: CALayerGetWritableState(CALayer*,CA::Tra...)

Malloc 56 Bytes - Resp. Library: QuartzCore - Resp. Frame: release_image(_CAImageQueue*,unsigned...)

Malloc 8 Bytes - Resp. Library: QuartzCore - Resp. Frame: CAAttrListSet

Malloc 8 Bytes - Resp. Library: QuartzCore - Resp. Frame: x_list_prepend_


I’ve searched where I’m using QuartCore in my app and I’ve just found it is used in EAGLView.m:

Code:

+ (Class)layerClass {
    return [CAEAGLLayer class];
}

//The GL view is stored in the nib file. When it's unarchived it's sent -initWithCoder:
- (id)initWithCoder:(NSCoder*)coder {

    if ((self = [super initWithCoder:coder])) {
        // Get the layer
        CAEAGLLayer *eaglLayer = (CAEAGLLayer *)self.layer;
       
        eaglLayer.opaque = YES;
        eaglLayer.drawableProperties = [NSDictionary dictionaryWithObjectsAndKeys:
                                        [NSNumber numberWithBool:NO], kEAGLDrawablePropertyRetainedBacking, kEAGLColorFormatRGBA8, kEAGLDrawablePropertyColorFormat, nil];
       
        context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES1];
               
        if (!context || ![EAGLContext setCurrentContext:context]) {
            [self release];
            return nil;
        }
     
        (...other code...)
}

- (BOOL)createFramebuffer {
   
    glGenFramebuffersOES(1, &viewFramebuffer);
    glGenRenderbuffersOES(1, &viewRenderbuffer);
   
    glBindFramebufferOES(GL_FRAMEBUFFER_OES, viewFramebuffer);
    glBindRenderbufferOES(GL_RENDERBUFFER_OES, viewRenderbuffer);
    [context renderbufferStorage:GL_RENDERBUFFER_OES fromDrawable:(CAEAGLLayer*)self.layer];
    glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_COLOR_ATTACHMENT0_OES, GL_RENDERBUFFER_OES, viewRenderbuffer);
   
    glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_WIDTH_OES, &backingWidth);
    glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_HEIGHT_OES, &backingHeight);
   
    if (USE_DEPTH_BUFFER) {
        glGenRenderbuffersOES(1, &depthRenderbuffer);
        glBindRenderbufferOES(GL_RENDERBUFFER_OES, depthRenderbuffer);
        glRenderbufferStorageOES(GL_RENDERBUFFER_OES, GL_DEPTH_COMPONENT16_OES, backingWidth, backingHeight);
        glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_DEPTH_ATTACHMENT_OES, GL_RENDERBUFFER_OES, depthRenderbuffer);
    }
   
    if(glCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES) != GL_FRAMEBUFFER_COMPLETE_OES) {
        NSLog(@"failed to make complete framebuffer object %x", glCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES));
        return NO;
    }
   
    return YES;
}


Does anybody know how to avoid this allocation leaks? Are they usual in QuartCore, or I’m doing something wrong with the CALayer?

Any help will be appreciated! :)

WP Like Button Plugin by Free WordPress Templates